Skip to content

fix(mocha): have tests clean up once complete #1511

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

Merged
merged 1 commit into from
Dec 20, 2015

Conversation

david-mohr
Copy link
Contributor

mocha unit and integration tests will hang unless express (and
optionally mongoose) are closed once the tests are complete

mocha unit and integration tests will hang unless express (and
optionally mongoose) are closed once the tests are complete
Awk34 added a commit that referenced this pull request Dec 20, 2015
fix(mocha): have tests clean up once complete
@Awk34 Awk34 merged commit 9bafd30 into angular-fullstack:canary Dec 20, 2015
@Awk34
Copy link
Member

Awk34 commented Dec 20, 2015

Hmm, looks like this isn't passing

1) Thing API: GET /api/things "before each" hook for "should respond with JSON array":
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.


2) Thing API: POST /api/things "before each" hook for "should respond with the newly created thing":
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.


3) Thing API: GET /api/things/:id "before each" hook for "should respond with the requested thing":
TypeError: Cannot read property '_id' of 
at Context.<anonymous> (server/api/thing/thing.integration.js:68:39)

4) Thing API: PUT /api/things/:id "before each" hook for "should respond with the updated thing":
TypeError: Cannot read property '_id' of undefined
at Context.<anonymous> (server/api/thing/thing.integration.js:96:39)

5) Thing API: DELETE /api/things/:id should respond with 204 on successful removal:
TypeError: Cannot read property '_id' of undefined
at Context.<anonymous> (server/api/thing/thing.integration.js:127:42)

6) Thing API: DELETE /api/things/:id should respond with 404 when thing does not exist:
TypeError: Cannot read property '_id' of undefined
at Context.<anonymous> (server/api/thing/thing.integration.js:139:42)

7) User API: "before all" hook for "should respond with 404 when thing does not exist":
Error: timeout of 5000ms exceeded. Ensure the done() callback is being called in this test.

@david-mohr
Copy link
Contributor Author

That's weird... What options did you pick to build this test set and command did you pass to gulp?

@Awk34
Copy link
Member

Awk34 commented Dec 21, 2015

It's the generator's tests. Run npm test from the generator's root. It currently doesn't run tests against Gulp.

@Awk34
Copy link
Member

Awk34 commented Dec 21, 2015

I backed-out this commit and ran the tests again and they ran fine. I'm going to revert this for now.

I think what's happening is that you're closing connections after one suite of tests runs, so that the connection isn't available when the next suite of tests tries to run.

@david-mohr
Copy link
Contributor Author

Leave it with me, I'll figure out why this change is failing.

@david-mohr
Copy link
Contributor Author

I've figured out what's going on, why it's happening and a workaround. Should I submit a new PR or update this one?

@Awk34
Copy link
Member

Awk34 commented Jan 4, 2016

A new one please

@david-mohr
Copy link
Contributor Author

New PR #1536 uses a global after clause and only applies to gulp

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

Successfully merging this pull request may close these issues.

2 participants