1.0.0 • Published 9 years ago

mocha-mongoose-fix-overwitemodelerror v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

mocha-mongoose-fix-overwitemodelerror

Fixes Mongoose issue #1251 with mocha in watch mode

Works best with mocha --require=env-test.

Why?

When you use Mongoose and run your tests with mocha --watch, on each reload you may encounter a fatal OverwriteModelError error.

How?

  • Install with npm install --save-dev mocha-mongoose-fix-overwitemodelerror
  • Edit test/mocha.opts and add the line --require=mocha-mongoose-fix-overwitemodelerror

This will ensure mocha models are properly (or brutally) reset before relaunching tests.