-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
chore: re-export AsymmetricMatcher
from @jest/expect
#12410
Conversation
@@ -10,7 +10,7 @@ | |||
- `[jest-environment-jsdom]` [**BREAKING**] Upgrade jsdom to 19.0.0 ([#12290](https://github.com/facebook/jest/pull/12290)) | |||
- `[jest-environment-jsdom]` [**BREAKING**] Add default `browser` condition to `exportConditions` for `jsdom` environment ([#11924](https://github.com/facebook/jest/pull/11924)) | |||
- `[jest-environment-node]` [**BREAKING**] Add default `node` and `node-addon` conditions to `exportConditions` for `node` environment ([#11924](https://github.com/facebook/jest/pull/11924)) | |||
- `[@jest/expect]` [**BREAKING**] New module which extends `expect` with `jest-snapshot` matchers ([#12404](https://github.com/facebook/jest/pull/12404)) |
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.
new module in itself isn't breaking 🙂
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.
Hm.. In a way expect
received minimal breaking change. That was the reason.
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.
yeah, I added a separate entry for it below. Any other breaking changes than the type removal?
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.
The breakage I had in mind is this funny line (;
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.
right. that probably should have thrown
all along, not be a no-op. Can call it out, tho
export type {JestExpect} from './types'; | ||
|
||
export function createJestExpect(): JestExpect { |
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.
I don't think exporting this is super useful. if it proves to be it's easy to add in the future
packages/jest-jasmine2/src/types.ts
Outdated
@@ -69,7 +69,7 @@ export type Jasmine = { | |||
version: string; | |||
testPath: string; | |||
addMatchers: (matchers: JasmineMatchersObject) => void; | |||
} & JestExpect & | |||
} & AsymmetricMatchers & |
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.
we just do this for .any
etc
@@ -69,8 +69,7 @@ export type Jasmine = { | |||
version: string; | |||
testPath: string; | |||
addMatchers: (matchers: JasmineMatchersObject) => void; | |||
} & JestExpect & | |||
typeof globalThis; | |||
} & AsymmetricMatchers & {process: NodeJS.Process}; |
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.
globalThis
only used for process
, so let's be a bit more precise
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
There might be other types we wanna export as well but at least exporting stuff people might import from
expect
seems reasonable./cc @mrazauskas
Test plan
Green CI