Skip to content

Commit 198fe2e

Browse files
committed
fixes code style
1 parent c6ca50e commit 198fe2e

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- `[jest-cli]` Include type definitions to generated config files ([#14078](https://github.com/facebook/jest/pull/14078))
66
- `[jest-snapshot]` Support arrays as property matchers ([#14025](https://github.com/facebook/jest/pull/14025))
7-
- `[jest-snapshot]` Add `toMatchNamedSnapshot` to bring snapshot support to concurrent mode
7+
- `[jest-snapshot]` Add `toMatchNamedSnapshot` to bring snapshot support to concurrent mode ([#14045](https://github.com/facebook/jest/pull/14045))
88

99
### Fixes
1010

packages/jest-snapshot/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const toMatchSnapshot: MatcherFunctionWithContext<
229229

230230
export const toMatchNamedSnapshot: MatcherFunctionWithContext<
231231
Context,
232-
[propertiesOrSnapshot?: object | string, snapshotName?: string]
232+
[propertiesOrSnapshotName?: object | string, snapshotName?: string]
233233
> = function (received, propertiesOrSnapshotName, snapshotName) {
234234
const matcherName = 'toMatchNamedSnapshot';
235235
let properties;

packages/jest-snapshot/src/types.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,16 @@ export interface SnapshotMatchers<R extends void | Promise<void>, T> {
5757
/**
5858
* This ensures that a value matches the specific snapshot.
5959
* Instead of use current test name in global state, it will use the specific name to find the snapshot.
60-
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
60+
*/
61+
toMatchNamedSnapshot(snapshotName?: string): R;
62+
/**
63+
* This ensures that a value matches the specific snapshot with property matchers.
64+
* Instead of use current test name in global state, it will use the specific name to find the snapshot.
6165
*/
6266
toMatchNamedSnapshot<U extends Record<keyof T, unknown>>(
6367
propertyMatchers: Partial<U>,
6468
snapshot?: string,
6569
): R;
66-
/**
67-
* This ensures that a value matches the specific snapshot.
68-
* Instead of use current test name in global state, it will use the specific name to find the snapshot.
69-
* Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information.
70-
*/
71-
toMatchNamedSnapshot(snapshotName?: string): R;
7270
/**
7371
* This ensures that a value matches the most recent snapshot with property matchers.
7472
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
@@ -93,12 +91,11 @@ export interface SnapshotMatchers<R extends void | Promise<void>, T> {
9391
* Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically.
9492
*/
9593
toThrowErrorMatchingInlineSnapshot(snapshot?: string): R;
96-
9794
/**
9895
* Used to test that a function throws a error matching the specific snapshot.
9996
* Instead of use current test name in global state, it will use the specific name to find the snapshot.
10097
*/
101-
toThrowErrorMatchingNamedSnapshot(name?: string): R;
98+
toThrowErrorMatchingNamedSnapshot(snapshotName?: string): R;
10299
}
103100

104101
export type SnapshotFormat = Omit<PrettyFormatOptions, 'compareKeys'>;

0 commit comments

Comments
 (0)