mocha-mongoose-fix-overwitemodelerror

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i mocha-mongoose-fix-overwitemodelerror

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • naholyr