-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into improve-each-template-literal-infer
- Loading branch information
Showing
69 changed files
with
4,655 additions
and
3,908 deletions.
There are no files selected for viewing
344 changes: 172 additions & 172 deletions
344
.yarn/releases/yarn-3.8.0.cjs → .yarn/releases/yarn-3.8.1.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Reporting a Vulnerability | ||
|
||
If you discover a security vulnerability within Jest, please submit a report via the GitHub's [Private Vulnerability Reporting](https://github.com/jestjs/jest/security/advisories) feature. | ||
|
||
All security vulnerabilities will be promptly addressed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
describe('matches circular references nested in:', () => { | ||
interface CircularObj { | ||
ref: unknown; | ||
[prop: string]: unknown; | ||
} | ||
|
||
test('arrays', () => { | ||
type CircularArray = CircularObj & {ref: Array<unknown>}; | ||
|
||
const a: CircularArray = {c: 1, ref: [1]}; | ||
const b: CircularArray = {c: 1, ref: [1]}; | ||
|
||
a.ref.push(a); | ||
b.ref.push(b); | ||
expect(a).toMatchObject(b); | ||
|
||
b.ref = []; | ||
expect(a).not.toMatchObject(b); | ||
|
||
b.ref = [1]; | ||
expect(a).not.toMatchObject(b); | ||
}); | ||
|
||
test('deeply nested array properties', () => { | ||
type DeepCircularArray = CircularObj & {ref: {inner: Array<unknown>}}; | ||
const a: DeepCircularArray = { | ||
c: 1, | ||
ref: { | ||
inner: [1], | ||
}, | ||
}; | ||
const b: DeepCircularArray = { | ||
c: 1, | ||
ref: { | ||
inner: [1], | ||
}, | ||
}; | ||
a.ref.inner.push(a); | ||
b.ref.inner.push(b); | ||
expect(a).toMatchObject(b); | ||
|
||
b.ref.inner = []; | ||
expect(a).not.toMatchObject(b); | ||
|
||
b.ref.inner = [1]; | ||
expect(a).not.toMatchObject(b); | ||
}); | ||
|
||
test('sets', () => { | ||
type CircularSet = CircularObj & {ref: Set<unknown>}; | ||
|
||
const a: CircularSet = {c: 1, ref: new Set()}; | ||
const b: CircularSet = {c: 1, ref: new Set()}; | ||
|
||
a.ref.add(a); | ||
b.ref.add(b); | ||
expect(a).toMatchObject(b); | ||
|
||
b.ref.clear(); | ||
expect(a).not.toMatchObject(b); | ||
|
||
b.ref.add(1); | ||
expect(a).not.toMatchObject(b); | ||
}); | ||
|
||
test('maps', () => { | ||
type CircularMap = CircularObj & {ref: Map<string, unknown>}; | ||
|
||
const a: CircularMap = {c: 1, ref: new Map()}; | ||
const b: CircularMap = {c: 1, ref: new Map()}; | ||
|
||
a.ref.set('innerRef', a); | ||
b.ref.set('innerRef', b); | ||
expect(a).toMatchObject(b); | ||
|
||
b.ref.clear(); | ||
expect(a).not.toMatchObject(b); | ||
|
||
b.ref.set('innerRef', 1); | ||
expect(a).not.toMatchObject(b); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.