-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Removes sinon from saved objects unit tests. #32045
Removes sinon from saved objects unit tests. #32045
Conversation
💔 Build Failed |
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.
Just have a few nits but LGTM once CI passes 👍 great work!
Promise.resolve({ | ||
items: [], | ||
}) | ||
); |
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.
nit: There's a shorter alternative you can do throughout, jest.fn().mockResolvedValue({ items: [] })
src/legacy/server/saved_objects/migrations/core/elastic_index.test.ts
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
* Removes sinon from saved objects unit tests. * Uses mockResolvedValue for return values as promises.
* Removes sinon from saved objects unit tests. * Uses mockResolvedValue for return values as promises.
* udpate jest, jest-cli, @types/jest to v24 * fix type error in kibana-i18n package * return serivce explicitly to fix typings * add explicit never * suppress typings errors * update jest versions in x-pack * make tests in x-pack more robust and fix incompatibility * suppress CallCluster mock typings Mock interface doesn't match CallCluster. Requires additional work * x-pack. resolve other typing conflicts * remove unused types/jest * fix snapshots * restore mocks after jest.spyOn * remove outdated definitions for jest * cleanup x-pack package.json and update @types/jest * fix tests merged from master * updated yarn.lock and log errors for scripts/type_check * This commit fixes error in TS, which failed on parsing the file. * suppress type errors from master * jest-cli is devDep Removes sinon from saved objects unit tests. (elastic#32045) (elastic#32151) * Removes sinon from saved objects unit tests. * Uses mockResolvedValue for return values as promises. temp
* udpate jest, jest-cli, @types/jest to v24 * fix type error in kibana-i18n package * return serivce explicitly to fix typings * add explicit never * suppress typings errors * update jest versions in x-pack * make tests in x-pack more robust and fix incompatibility * suppress CallCluster mock typings Mock interface doesn't match CallCluster. Requires additional work * x-pack. resolve other typing conflicts * remove unused types/jest * fix snapshots * restore mocks after jest.spyOn * remove outdated definitions for jest * cleanup x-pack package.json and update @types/jest * fix tests merged from master * updated yarn.lock and log errors for scripts/type_check * This commit fixes error in TS, which failed on parsing the file. * suppress type errors from master * jest-cli is devDep Removes sinon from saved objects unit tests. (#32045) (#32151) * Removes sinon from saved objects unit tests. * Uses mockResolvedValue for return values as promises. temp
Jest mocking offers compatible feature set to sinon. Even though some of the
sinon
conventions might be preferred, it is in our best interest to use jest as there is really no need for mixing tests with jest mocking and sinon.