-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(test:server): ensure db seeding completes before test run #352
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
Comments
👍 sounds good to me. |
I'm not convinced that There are two ways to write server tests, both represented in the default generation. One way is to assume a seeded database like the The primary goal here is to ensure there is no async database operations in process prior to running tests. A secondary goal is the ability to configure in which environment(s) seeding takes place. I believe there are two options:
I prefer option 1. Finally, we should cleanup some of the redundancy in the seeding process. For example, the same list of things is in the |
Thought of a third option that should take less effort - just change the tests to be independent of seeding by default.
|
The db operations in server/config/seed.js are async, which may allow the express app to startup prior to the database seeding completes. This causes an interment failure of the server unit tests. Found while researching Travis build error, details here
Creating an issue so we don't loose track of this. I'll have time to fix later this week. Thinking of using caolan/async as a devDependency of the generated app should do the trick.
CC: @JaKXz @chester1000 @apercu
The text was updated successfully, but these errors were encountered: