-
-
Notifications
You must be signed in to change notification settings - Fork 97
1487 backend test fixes #1876
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
1487 backend test fixes #1876
Conversation
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
trillium
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work here Danny!
| "test:client": "cd client && npm run test", | ||
| "test:client-mvp": "cd client-mvp-04 && npm run test", | ||
| "test:all": "cross-env NODE_ENV=test npm run test:client && npm run test:client-mvp && npm run test:backend && npm run test:cy" | ||
| "test:all": "cross-env NODE_ENV=test npm run test:client && npm run test:backend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing for clarity here that we're removing test:client-mvp and test:cy
|
I don't really have notes to provide because I don't understand this test suite all that much at the moment, but its been broken for a minute and we're moving towards getting it resolved!~ |
Addresses #1487
What changes did you make and why did you make them ?
Fixed backend tests so that they all pass (most of the time)
backend/models/project.test.jsby puttingsetupDBmethod inbeforeAllit was creating infinite regression.setupDBhas abeforeAllblock inside it.backend/models/user.test.js, same asbackend/models/project.test.jsbackend/workers/createRecurringEvents.test.jsmocked versions of all methods were being imported because ofbackend/jest.setup.jsline 15jest.mock('./workers/createRecurringEvents');. None of the expected calls were happening. Usingjest.requireActualfixes the problem.backend/workers/createRecurringEvents.test.jsthere were several error logs that could be fixed by setting a default resolved value forfetchAdjusted `package.json` so that `npm run test:all` will successfully complete client and backend tests.
package.jsontest:allwas referencing outdated scripts forclient-mvpand was terminating before backend tests. Also, cypress tests are not working because of a lack of a custom header.NOTE
Some tests are still failing intermittently due to some configuration issue, likely with the setting up of Mongoose. This needs more investigation, but it seemed worthwhile to fix these tests while I was working on it.
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
Visuals after changes are applied