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
Support expect.addSnapshotSerializer()
#29
Support expect.addSnapshotSerializer()
#29
Conversation
This runner can probably import and use |
Good idea, I'll have a test. |
It doesn't work as expected, but maybe because there are multiple version of |
|
No error, but
Can't, haven't updated Jest. |
Yah, that's the problem. I didn't install Can this cause problem? Not sure. |
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.
@jest/expect
is just a tiny wrapper around expect
(https://unpkg.com/browse/@jest/expect@28.0.2/build/index.js), so it shouldn't cause any problem that we cannot already have with the direct dependency on expect
I'm assuming the tests will pass on |
@@ -1,18 +1,10 @@ | |||
/* eslint-disable import/extensions */ | |||
|
|||
import mock from "jest-mock"; | |||
import { expect } from "expect"; | |||
import { jestExpect as expect } from "@jest/expect"; | |||
import snapshot from "jest-snapshot"; |
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.
unused
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! Fixed in 9b0a402
Fixes #28
I haven't test, but seems this is how it works. https://github.com/facebook/jest/blob/bb0956589f9dbddcc13db0f42b2d4d9ff642b2cd/packages/jest-expect/src/index.ts#L35Tested, it works.