Open mringer opened 7 years ago
@matthewringer Can you provide a link to the specific line in this project that are causing this issue?
How can I reproduce?
The steps to reproduce:
Starting from a cloned instance of MeanJS with NPM dependencies installed.
Tests for the new module fail with:
1) 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
2) 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.
https://github.com/mochajs/mocha/issues/2407