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

fix(jest-worker): hangs caused by failed assertions with circular values #15191

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 0 additions & 41 deletions e2e/__tests__/__snapshots__/bigintInequality.test.ts.snap

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`handles \`BigInt\` 1`] = `
"FAIL __tests__/test-1.js
● test

expect(received).toBe(expected) // Object.is equality

Expected: 73n
Received: 42n

1 | it('test', () => {
> 2 | expect(BigInt(42)).toBe(BigInt(73));
| ^
3 | });

at Object.toBe (__tests__/test-1.js:2:22)

FAIL __tests__/test-2.js
● test

expect(received).toBe(expected) // Object.is equality

Expected: 73n
Received: 42n

1 | it('test', () => {
> 2 | expect(BigInt(42)).toBe(BigInt(73));
| ^
3 | });

at Object.toBe (__tests__/test-2.js:2:22)"
`;

exports[`handles \`BigInt\` 2`] = `
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;

exports[`handles \`Map\` 1`] = `
"FAIL __tests__/test-1.js
● test

expect(received).toEqual(expected) // deep equality

- Expected - 1
+ Received + 1

Map {
- 1 => "3",
+ 1 => "2",
}

1 | it('test', () => {
> 2 | expect(new Map([[1, "2"]])).toEqual(new Map([[1, "3"]]));
| ^
3 | });

at Object.toEqual (__tests__/test-1.js:2:31)

FAIL __tests__/test-2.js
● test

expect(received).toEqual(expected) // deep equality

- Expected - 1
+ Received + 1

Map {
- 1 => "3",
+ 1 => "2",
}

1 | it('test', () => {
> 2 | expect(new Map([[1, "2"]])).toEqual(new Map([[1, "3"]]));
| ^
3 | });

at Object.toEqual (__tests__/test-2.js:2:31)"
`;

exports[`handles \`Map\` 2`] = `
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;

exports[`handles \`Symbol\` 1`] = `
"FAIL __tests__/test-1.js
● test

expect(received).toEqual(expected) // deep equality

Expected: Symbol(b)
Received: Symbol(a)

1 | it('test', () => {
> 2 | expect(Symbol('a')).toEqual(Symbol('b'));
| ^
3 | });

at Object.toEqual (__tests__/test-1.js:2:23)

FAIL __tests__/test-2.js
● test

expect(received).toEqual(expected) // deep equality

Expected: Symbol(b)
Received: Symbol(a)

1 | it('test', () => {
> 2 | expect(Symbol('a')).toEqual(Symbol('b'));
| ^
3 | });

at Object.toEqual (__tests__/test-2.js:2:23)"
`;

exports[`handles \`Symbol\` 2`] = `
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;

exports[`handles functions 1`] = `
"FAIL __tests__/test-1.js
● test

expect(received).toEqual(expected) // deep equality

Expected: [Function fn2]
Received: [Function fn1]

2 | const fn1 = () => {};
3 | const fn2 = () => {};
> 4 | expect(fn1).toEqual(fn2);
| ^
5 | });

at Object.toEqual (__tests__/test-1.js:4:15)

FAIL __tests__/test-2.js
● test

expect(received).toEqual(expected) // deep equality

Expected: [Function fn2]
Received: [Function fn1]

2 | const fn1 = () => {};
3 | const fn2 = () => {};
> 4 | expect(fn1).toEqual(fn2);
| ^
5 | });

at Object.toEqual (__tests__/test-2.js:4:15)"
`;

exports[`handles functions 2`] = `
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;

exports[`handles mixed structure 1`] = `
"FAIL __tests__/test-1.js
● test

expect(received).toEqual(expected) // deep equality

Expected: false
Received: {"bigInt": 42n, "fn": [Function anonymous], "map": Map {1 => "2"}, "ref": [Circular], "symbol": Symbol(asd), Symbol(qwe): Symbol(zxc)}

11 | method() {}
12 | }
> 13 | expect(new Class()).toEqual(false);
| ^
14 | });

at Object.toEqual (__tests__/test-1.js:13:23)

FAIL __tests__/test-2.js
● test

expect(received).toEqual(expected) // deep equality

Expected: false
Received: {"bigInt": 42n, "fn": [Function anonymous], "map": Map {1 => "2"}, "ref": [Circular], "symbol": Symbol(asd), Symbol(qwe): Symbol(zxc)}

11 | method() {}
12 | }
> 13 | expect(new Class()).toEqual(false);
| ^
14 | });

at Object.toEqual (__tests__/test-2.js:13:23)"
`;

exports[`handles mixed structure 2`] = `
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites."
`;
54 changes: 0 additions & 54 deletions e2e/__tests__/bigintInequality.test.ts

This file was deleted.

Loading
Loading