Skip to content

Commit 2842eb6

Browse files
authored
feat(pretty-format)!: remove ConvertAnsi plugin in favour of jest-serializer-ansi-escapes (#13040)
1 parent f96bc2a commit 2842eb6

File tree

8 files changed

+6
-140
lines changed

8 files changed

+6
-140
lines changed

CHANGELOG.md

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

55
- `[jest-config]` [**BREAKING**] Make `snapshotFormat` default to `escapeString: false` and `printBasicPrototype: false` ([#13036](https://github.com/facebook/jest/pull/13036))
66
- `[jest-environment-jsdom]` [**BREAKING**] Upgrade to `jsdom@20` ([#13037](https://github.com/facebook/jest/pull/13037))
7+
- `[pretty-format]` [**BREAKING**] Remove `ConvertAnsi` plugin in favour of `jest-serializer-ansi-escapes` ([#13040](https://github.com/facebook/jest/pull/13040))
78

89
### Fixes
910

docs/UpgradingToJest29.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ If you want to keep the old behavior, you can set the `snapshotFormat` property
3131
## JSDOM upgrade
3232

3333
`jest-environment-jsdom` has upgraded `jsdom` from v19 to v20. Due to issues with `@types/jsdom`, if you extend this environment, you might run into type errors. See https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60999#discussioncomment-3158685.
34+
35+
## `pretty-format`
36+
37+
`ConvertAnsi` plugin is removed in favour of [`jest-serializer-ansi-escapes`](https://github.com/mrazauskas/jest-serializer-ansi-escapes).

packages/pretty-format/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
"types": "./build/index.d.ts",
1616
"default": "./build/index.js"
1717
},
18-
"./package.json": "./package.json",
19-
"./ConvertAnsi": "./build/plugins/ConvertAnsi.js"
18+
"./package.json": "./package.json"
2019
},
2120
"author": "James Kyle <[email protected]>",
2221
"dependencies": {
2322
"@jest/schemas": "^29.0.0-alpha.0",
24-
"ansi-regex": "^5.0.1",
2523
"ansi-styles": "^5.0.0",
2624
"react-is": "^18.0.0"
2725
},

packages/pretty-format/src/__tests__/ConvertAnsi.test.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

packages/pretty-format/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
printObjectProperties,
1616
} from './collections';
1717
import AsymmetricMatcher from './plugins/AsymmetricMatcher';
18-
import ConvertAnsi from './plugins/ConvertAnsi';
1918
import DOMCollection from './plugins/DOMCollection';
2019
import DOMElement from './plugins/DOMElement';
2120
import Immutable from './plugins/Immutable';
@@ -536,7 +535,6 @@ export function format(val: unknown, options?: OptionsReceived): string {
536535

537536
export const plugins = {
538537
AsymmetricMatcher,
539-
ConvertAnsi,
540538
DOMCollection,
541539
DOMElement,
542540
Immutable,

packages/pretty-format/src/plugins/ConvertAnsi.ts

Lines changed: 0 additions & 73 deletions
This file was deleted.

scripts/buildUtils.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ export function getPackages() {
6969
...(pkg.name === 'expect'
7070
? {'./build/matchers': './build/matchers.js'}
7171
: {}),
72-
...(pkg.name === 'pretty-format'
73-
? {'./ConvertAnsi': './build/plugins/ConvertAnsi.js'}
74-
: {}),
7572
},
7673
`Package "${pkg.name}" does not export correct files`,
7774
);

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17945,7 +17945,6 @@ __metadata:
1794517945
"@types/react": ^17.0.3
1794617946
"@types/react-is": ^17.0.0
1794717947
"@types/react-test-renderer": 17.0.2
17948-
ansi-regex: ^5.0.1
1794917948
ansi-styles: ^5.0.0
1795017949
expect: ^29.0.0-alpha.0
1795117950
immutable: ^4.0.0

0 commit comments

Comments
 (0)