Skip to content
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

feat(pretty-format): expose ConvertAnsi plugin #12308

Merged
merged 3 commits into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Features

- `[pretty-format]` Expose `ConvertAnsi` plugin ([#12308](https://github.com/facebook/jest/pull/12308))

### Fixes

- `[expect]` Add type definitions for asymmetric `closeTo` matcher ([#12304](https://github.com/facebook/jest/pull/12304))
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
escapeString: false,
},
snapshotSerializers: [
// change to require.resolve('pretty-format/ConvertAnsi') when we drop Node 10
'<rootDir>/packages/pretty-format/build/plugins/ConvertAnsi.js',
],
testPathIgnorePatterns: [
Expand Down
3 changes: 2 additions & 1 deletion packages/pretty-format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"types": "./build/index.d.ts",
"default": "./build/index.js"
},
"./package.json": "./package.json"
"./package.json": "./package.json",
"./ConvertAnsi": "./build/plugins/ConvertAnsi.js"
},
"author": "James Kyle <me@thejameskyle.com>",
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions scripts/buildUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ module.exports.getPackages = function getPackages() {
'./build/utils': './build/utils.js',
}
: {}),
...(pkg.name === 'pretty-format'
? {'./ConvertAnsi': './build/plugins/ConvertAnsi.js'}
: {}),
},
`Package ${pkg.name} does not export correct files`,
);
Expand Down