Skip to content

Commit

Permalink
update failing test for new message in node 16.9
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 16, 2021
1 parent 3bff1fa commit 35cf071
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@types/is-ci": "^3.0.0",
"@types/micromatch": "^4.0.1",
"jest-snapshot-serializer-raw": "^1.1.0",
"semver": "^7.3.5",
"strip-ansi": "^6.0.0",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
Expand Down
9 changes: 6 additions & 3 deletions packages/jest-config/src/__tests__/normalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {createHash} from 'crypto';
import path from 'path';
import {wrap} from 'jest-snapshot-serializer-raw';
import semver = require('semver');
import stripAnsi from 'strip-ansi';
import type {Config} from '@jest/types';
import {escapeStrForRegex} from 'jest-regex-util';
Expand Down Expand Up @@ -1130,6 +1131,10 @@ describe('preset', () => {
{virtual: true},
);

const errorMessage = semver.satisfies(process.versions.node, '>=16.9.1')
? "TypeError: Cannot read properties of undefined (reading 'call')"
: /TypeError: Cannot read property 'call' of undefined[\s\S]* at /;

await expect(
normalize(
{
Expand All @@ -1138,9 +1143,7 @@ describe('preset', () => {
},
{} as Config.Argv,
),
).rejects.toThrowError(
/TypeError: Cannot read property 'call' of undefined[\s\S]* at /,
);
).rejects.toThrowError(errorMessage);
});

test('works with "react-native"', async () => {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12681,6 +12681,7 @@ fsevents@^1.2.7:
jest-validate: ^27.2.0
micromatch: ^4.0.4
pretty-format: ^27.2.0
semver: ^7.3.5
strip-ansi: ^6.0.0
ts-node: ^9.0.0
typescript: ^4.0.3
Expand Down

0 comments on commit 35cf071

Please sign in to comment.