-
Notifications
You must be signed in to change notification settings - Fork 7
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
[no-issue]: Convert database tests to jest #4188
Conversation
@@ -101,17 +99,5 @@ describe('DataElement', () => { | |||
); | |||
}); | |||
}); | |||
|
|||
it('should remove valid fields when empty', () => { |
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.
This was a duplicate test case wtih a misleading name
e744b7a
to
edf3d4e
Compare
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.
Looked through and all looks good to me! Great that you caught a few things like that dupe test, some unneeded awaits, and even the language used to describe each test case.
Thanks for swooping in with your tech debt cleaning super powers, Open Source Community 😁
runSql: (query, replacementParams) => ({ query, replacementParams }), | ||
}; | ||
|
||
describe('migrationUtilities', () => { |
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.
Restructured this file a bit to make it less verbose
Have enabled auto-merge, will be committed to dev as soon as CI/CD checks have passed. |
Ah nice, that's a handy feature! A few dev scripts have been touched because of the test folder update. I guess that if anything has been messed up the CI/CD will tell :-) |
// responseDescriptionFields, | ||
// )}`; | ||
|
||
expect(surveyResponse).toHaveProperty('outdated', expected); |
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.
Using a 3rd parameter (for a custom message) is not only unsupported by jest
, but it causes toHaveProperty
to always pass! 😨
Interestingly this is not the case with toBe
, which fails as expected. I double-checked that the only instance where custom messages are still used in this package is in AnalyticsRefresher.test.js, for .toBe
assertions.
2 more packages (
central-server
,web-config-server
) and thenmocha
can go! 🎉Most of the job was done using a community codemod