Skip to content

Commit

Permalink
feat(pretty-format): expose ConvertAnsi plugin (#12308)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 6, 2022
1 parent 94a6752 commit 5a95898
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
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
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
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
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

0 comments on commit 5a95898

Please sign in to comment.