tntim96/JSCover

report file jscoverage.html is abnormal

lzf-bupt opened this issue · 7 comments

Hello, when I use jscover-2.0.12 and execute the command "Java - jar target / dist / jscover-all.jar - WS -- document root = doc / example -- report dir = target", the coverage information can be displayed correctly, but the code coverage displayed in the jscoverage.html file exported to the target folder is always 0. Do you know how to solve this problem?
image

The screenshot of the test process is like this
image

This is probably a browser permissions issue, see the FAQ for information.

In short, Chrome needs to start with --allow-file-access-from-files. For FireFox set the privacy.file_unique_origin config option to false. Let me know what browser you're using and I'll see if it needs a similar security setting.

I use Google browser. I used your suggestion to start Google browser with the "chrome.exe --allow-file-access-from-files" command in the command line window, and then I used the "java -jar target/dist/JSCover-all.jar -ws --document-root=doc/example --report-dir=target" command. During the test, the code coverage information can be displayed correctly, but the code coverage is still 0 in the jscoverage.html file of the exported report.

Is an error displayed in the dev-tools console?

When I start Google browser with the "- allow file access from files" command and 'java -jar target/dist/JSCover-all.jar -ws --document-root=doc/example --report-dir=target', it can enter‘ https://localhost:8080/jscoverage.html ’, and sometimes it cannot enter ‘https://localhost:8080/jscoverage.html '.

I changed from Google browser to Firefox browser, and the reports exported after “setting the 'privacy.file_unique_origin' config option to false” can be opened normally with Google browser. Thank you