You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running tests on a generated CRUD module, I noticed multiple errors from MochaJS regarding Resolution Method Over Specification. It looks like the server template code is both returning a promise as well as calling .done() which aggravates Mocha.
Starting from a cloned instance of MeanJS with NPM dependencies installed.
Create a new CRUD module in my case "service" via the yo generator. $ yo meanjs:crud-module service
Run server tests: $ npm run test:server
Tests for the new module fail with:
Service Model Unit Tests: Method Save should be able to save without problems:
Error: Resolution method is overspecified. Specify a callback or return a Promise; not both.
at modules/services/tests/server/service.server.model.tests.js:47:9
at node_modules/mongoose/lib/model.js:3327:16
at node_modules/mongoose/lib/document.js:1927:18
Service Model Unit Tests: Method Save should be able to show an error when try to save without name:
Error: Resolution method is overspecified. Specify a callback or return a Promise; not both.
at modules/services/tests/server/service.server.model.tests.js:56:9
at node_modules/mongoose/lib/model.js:3327:16
at node_modules/mongoose/lib/document.js:1932:15
I created a PR which removes the offending promise returns.
Running tests on a generated CRUD module, I noticed multiple errors from MochaJS regarding Resolution Method Over Specification. It looks like the server template code is both returning a promise as well as calling .done() which aggravates Mocha.
mochajs/mocha#2407
The text was updated successfully, but these errors were encountered: