tntim96 / JSCover

JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage
GNU General Public License v2.0
399 stars 84 forks source link

i use the simple ws mode , but coverage is always 0 #295

Closed kathxqq closed 4 years ago

kathxqq commented 4 years ago

arfter i start the ws , test cases in the frame .and then click the store button ,but the line excute times is always 0 ; when i try the proxy mode , meet the same problem

web server start command - java -jar JSCover-all.jar -ws --port=8085 --document-root=/app/docker/hoc/openresty/html/test --report-dir=../hh

proxy server start command - java -Dfile.encoding=UTF-8 -jar target/dist/JSCover-all.jar -ws --proxy --port=3128 --report-dir=target/holmes-admin --document-root=E:\holmes-admin\mock --include-unloaded -js --local-storage --log=FINESTclks

the jscoverage.json is like this: {"/0.9eca228381fde33171e6.js":{"lineData":[null,null,0],"functionData":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],

image

tntim96 commented 4 years ago

Is there any error in JSCover's logs? I'd probably need to see the code in 0.9eca228381fde33171e6.js to help further.

kathxqq commented 4 years ago

Is there any error in JSCover's logs? I'd probably need to see the code in 0.9eca228381fde33171e6.js to help further.

no error have been found .

but i solved the problem by changing the port from 3128 to be 9528 which is the same as the web to be tested . following is my steps , hope can help:

1、 i start a local service ,which port is 9528 2、start the proxy : java -Dfile.encoding=UTF-8 -jar target/dist/JSCover-all.jar -ws --proxy --port=3128 --report-dir=target/0901/1439 --local-storage --log=FINEST 3、 image

then the proxy mode works , i can get the coverage data

tntim96 commented 4 years ago

but i solved the problem by changing the port from 3128 to be 9528

Great.