mantoni / mochify.js

☕️ TDD with Browserify, Mocha, Headless Chrome and WebDriver
MIT License
346 stars 57 forks source link

nyc support #185

Closed mantoni closed 5 years ago

mantoni commented 5 years ago

Work in progress! Do not merge!

This is an attempt to integrate integrates mochify with nyc. It works for small projects, but requires quite some complicated setup.

It might be a better option to write a custom transform in this project, that uses the recent implementation of the istanbul instrumenter directly.

Ref https://github.com/sinonjs/sinon/issues/1948

mantoni commented 5 years ago

It's quite a hack, but it works fine. I'd go with this for now. I've applied the new instructions in the readme successfully to a small project and to Sinon.JS.

mantoni commented 5 years ago

I tried coming up with a test case, but it's really hard, given that the tests are all integration style.

mroderick commented 5 years ago

That is indeed an elaborate script

mantoni commented 5 years ago

I managed to bring it down by using a nyc config in the package.json and by invoking npm run test-headless decorated with the additional argument. I just released mochify 6 with all the updates and will send a PR for Sinon now.