mocha: browserify breaks at require('./lib-cov/mocha')

mocha/index.js:

module.exports = process.env.COV
  ? require('./lib-cov/mocha')
  : require('./lib/mocha');
Error: module "./lib-cov/mocha" not found from "/Volumes/work/Projects/yaas/node_modules/mocha/index.js"

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 27 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Why is mocha conditionally requiring a file that does not exist? Is this file generated under some conditions? What triggers this file to be generated?

@SonofNun15 It’s all in the makefile. when running test-cov it uses the jscoverage tool to instrument the code into lib-cov - then mocha runs with the COV environment variable set to report out coverage for the instrumented code… The initial discussion is in #5 and d4666c2 is the initial commit.

@boneskull I see you added PR PLEASE – what’s the scope of a PR you’d accept? To switch coverage to something less obtrusive – or get require('mocha') under browserify working?

I think this can be fixed by ignoring lib-cov/mocha, i.e. adding "./lib-cov/mocha": false to the browser field in package.json