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

HTTPS proxy support #212

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

We are looking for proxy support for HTTPS as we cannot use anything but proxy mode for our setup due to complications with file system mode.

We would need this feature soon otherwise we will lose all coverage.

Can we know when HTTPS proxy support can be expected?

tntim96 commented 9 years ago

See https://github.com/tntim96/JSCover/issues/198

I have no plan to implement this any time soon, but feel free to contribute if you have any good ideas of how to implement this.

The most promising option appears to be to integrate with https://github.com/adamfisk/LittleProxy, but I'm not sure it's possible to modify the content in the proxy easily.

The complications of using file-mode are usually worth overcoming.

ghost commented 9 years ago

Hi,

I am trying to use file-based approach to get this working.

Basically i have generated instrumented source using

java -jar jscover-all.jar SourceFolder DestinaionFolder

I replaced the SourceFolder code with the instrumented code in DestinationFolder(which is basically copying everything from destination except a folder called 'original-src')

I am starting jscover like this in a parallel terminal window,

java -jar jscover-all.jar -ws --report-dir=/tmp/dir --log=FINE --port=8080

also making sure the right port is being used through the code.

When I debug to see in the test browser, I do not see any instrumented js loaded in the browser and so no coverage is obtained. Is the instrumentation technique I am following correct? Am I missing something?

tntim96 commented 9 years ago

After you instrument in file mode you don't need to run JSCover in server mode.

Take a look at this example which shows all the necessary steps.

ghost commented 9 years ago

But we are not using local-storage and so running JSCover in server mode to get report.

tntim96 commented 9 years ago

You don't need it to get the report either. See Programmatic Report Storage in the manual.