Skip to content

Commit

Permalink
test(@sounisi5011/jest-binary-data-matchers): migrate from `pretty-fo…
Browse files Browse the repository at this point in the history
…rmat` to `jest-serializer-ansi-escapes`

The `ConvertAnsi` plugin has been removed from `pretty-format` by [#13040]. The replacement is [`jest-serializer-ansi-escapes`].

[#13040]: jestjs/jest#13040
[`jest-serializer-ansi-escapes`]: https://github.com/mrazauskas/jest-serializer-ansi-escapes
  • Loading branch information
sounisi5011 committed Jul 22, 2022
1 parent 28b190f commit 7e447be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/jest-matchers/binary-data/package.json
Expand Up @@ -65,7 +65,7 @@
"@types/node": "12.20.55",
"cross-env": "7.0.3",
"jest": "28.1.2",
"pretty-format": "28.1.1",
"jest-serializer-ansi-escapes": "2.0.1",
"typescript": "4.7.4"
},
"peerDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-matchers/binary-data/tests/index.ts
@@ -1,11 +1,10 @@
import '../src';

// import ConvertAnsiPlugin from 'pretty-format/ConvertAnsi';
import { plugins as prettyFormatPlugins } from 'pretty-format';
import ansiEscapesSerializer from 'jest-serializer-ansi-escapes';

import { getBytesDataList, toIntAndBigintCases, unshiftInspect } from './helpers';

expect.addSnapshotSerializer(prettyFormatPlugins.ConvertAnsi);
expect.addSnapshotSerializer(ansiEscapesSerializer);

{
const byteSizeList: number[] = [0, 1, 2 ** 10, 2 ** 20, 2 ** 30, 2 ** 40, 2 ** 50];
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-matchers/binary-data/tests/invalid-value.ts
@@ -1,11 +1,10 @@
import '../src';

// import ConvertAnsiPlugin from 'pretty-format/ConvertAnsi';
import { plugins as prettyFormatPlugins } from 'pretty-format';
import ansiEscapesSerializer from 'jest-serializer-ansi-escapes';

import * as matcherList from '../src/matchers';

expect.addSnapshotSerializer(prettyFormatPlugins.ConvertAnsi);
expect.addSnapshotSerializer(ansiEscapesSerializer);

const invalidValueList = [
undefined,
Expand Down
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e447be

Please sign in to comment.