Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRUD Module Server Test Templates over specify the resolution method. #254

Open
mringer opened this issue Oct 7, 2016 · 2 comments
Open

Comments

@mringer
Copy link

mringer commented Oct 7, 2016

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

mringer added a commit to mringer/generator-meanjs that referenced this issue Oct 7, 2016
Fixes MochaJS MochaJS Resolution Method Over Specification in test template code.
@mleanos
Copy link
Member

mleanos commented Oct 7, 2016

@matthewringer Can you provide a link to the specific line in this project that are causing this issue?

How can I reproduce?

@mringer
Copy link
Author

mringer commented Oct 7, 2016

The steps to reproduce:

Starting from a cloned instance of MeanJS with NPM dependencies installed.

  1. Create a new CRUD module in my case "service" via the yo generator. $ yo meanjs:crud-module service
  2. Run server tests: $ npm run test:server

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.

#255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants