benbria / coffee-coverage

Istanbul and JSCoverage-style instrumentation for CoffeeScript files.
MIT License
145 stars 31 forks source link

coffee-coverage with CucumberJS #79

Open mjhm opened 8 years ago

mjhm commented 8 years ago

FYI. I'm using coffee-coverage with CucumberJS as the test runner. This worked fine for me with a small hack to get around a CucumberJS issue.

./node_modules/.bin/cucumberjs \
  --require node_modules/coffee-coverage/register-istanbul.js \
  --require $path_root/features \
  --compiler coffee:coffee-script/register $*

My application is a Node REST-like API, with the application running in the same process as the test runner. I would imagine that instrumenting code coverage for the more typical Cucumber use case -- feature tests with Selenium browser automation -- would be difficult because the SUT runs in a different process from the runner. However I suppose JSDom could possibly work instead of Selenium for getting code coverage from tests.