You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1622: Update Jest r=curquiza a=flevi29
# Pull Request
## Related issue
Fixes#1621
## What does this PR do?
- because newer versions of jest doesn't include anymore "jest-environment-jsdom", add it as development dependency
- because newer versions of jest simplified snapshots, update them accordingly
- this means replacing `Object {` with `{` and `Array [` with `[`
- because newer versions of jest support builtin `fetch` from newer versions of Node.js, add a global setup script that disables builtin `fetch`
- this is because builtin `fetch` breaks a lot of tests, regarding errors, abort, and even objects created by `fetch` are different, for instance some arrays no longer return `true` for `expect.any(Array)` (something to do with `instanceof Array`) (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray#description)
- `jasmine` `fail()` doesn't work anymore, but it still fails the tests, except with a less convenient error message `ReferenceError: fail is not defined` https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults EDIT: just realized it says here that we can set `"testRunner": "jest-jasmine2"`, but I tried it and `fail()` is still undefined
- should fix this in a separate PR, where we fix/improve the tests, this PR is about updating Jest and making minimal code changes for it to work
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Co-authored-by: F. Levi <[email protected]>
0 commit comments