Skip to content

Commit

Permalink
Update jest escapeString config (#26140)
Browse files Browse the repository at this point in the history
## Summary

In jest v29, snapshotFormat default to escapeString:
false(jestjs/jest#13036)

## How did you test this change?

ci green
  • Loading branch information
ymqy committed Feb 9, 2023
1 parent 6ddcbd4 commit 3569831
Show file tree
Hide file tree
Showing 17 changed files with 242 additions and 243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2500,7 +2500,7 @@ describe('InspectedElement', () => {
Object {
"errors": Array [
Array [
"Warning: Each child in a list should have a unique \\"key\\" prop. See https://reactjs.org/link/warning-keys for more information.
"Warning: Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.
at Example",
1,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('profiling charts', () => {
"actualDuration": 0,
"didRender": true,
"id": 5,
"label": "Memo(Child) key=\\"third\\" (<0.1ms of <0.1ms)",
"label": "Memo(Child) key="third" (<0.1ms of <0.1ms)",
"name": "Memo(Child)",
"offset": 15,
"selfDuration": 0,
Expand All @@ -135,7 +135,7 @@ describe('profiling charts', () => {
"actualDuration": 2,
"didRender": true,
"id": 4,
"label": "Memo(Child) key=\\"second\\" (2ms of 2ms)",
"label": "Memo(Child) key="second" (2ms of 2ms)",
"name": "Memo(Child)",
"offset": 13,
"selfDuration": 2,
Expand All @@ -145,7 +145,7 @@ describe('profiling charts', () => {
"actualDuration": 3,
"didRender": true,
"id": 3,
"label": "Memo(Child) key=\\"first\\" (3ms of 3ms)",
"label": "Memo(Child) key="first" (3ms of 3ms)",
"name": "Memo(Child)",
"offset": 10,
"selfDuration": 3,
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('profiling charts', () => {
"actualDuration": 0,
"didRender": false,
"id": 5,
"label": "Memo(Child) key=\\"third\\"",
"label": "Memo(Child) key="third"",
"name": "Memo(Child)",
"offset": 15,
"selfDuration": 0,
Expand All @@ -186,7 +186,7 @@ describe('profiling charts', () => {
"actualDuration": 0,
"didRender": false,
"id": 4,
"label": "Memo(Child) key=\\"second\\"",
"label": "Memo(Child) key="second"",
"name": "Memo(Child)",
"offset": 13,
"selfDuration": 0,
Expand All @@ -196,7 +196,7 @@ describe('profiling charts', () => {
"actualDuration": 0,
"didRender": false,
"id": 3,
"label": "Memo(Child) key=\\"first\\"",
"label": "Memo(Child) key="first"",
"name": "Memo(Child)",
"offset": 10,
"selfDuration": 0,
Expand Down Expand Up @@ -267,19 +267,19 @@ describe('profiling charts', () => {
},
Object {
"id": 3,
"label": "Memo(Child) (Memo) key=\\"first\\" (3ms)",
"label": "Memo(Child) (Memo) key="first" (3ms)",
"name": "Memo(Child)",
"value": 3,
},
Object {
"id": 4,
"label": "Memo(Child) (Memo) key=\\"second\\" (2ms)",
"label": "Memo(Child) (Memo) key="second" (2ms)",
"name": "Memo(Child)",
"value": 2,
},
Object {
"id": 5,
"label": "Memo(Child) (Memo) key=\\"third\\" (<0.1ms)",
"label": "Memo(Child) (Memo) key="third" (<0.1ms)",
"name": "Memo(Child)",
"value": 0,
},
Expand Down
22 changes: 11 additions & 11 deletions packages/react-devtools-shared/src/__tests__/storeOwners-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ describe('Store owners list', () => {
const rootID = store.getElementIDAtIndex(0);
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
" ▾ <Root>
▾ <Intermediate key=\\"intermediate\\">
▾ <Intermediate key="intermediate">
<Leaf>
<Leaf key=\\"leaf\\">"
<Leaf key="leaf">"
`);

const intermediateID = store.getElementIDAtIndex(1);
expect(getFormattedOwnersList(intermediateID)).toMatchInlineSnapshot(`
" ▾ <Intermediate key=\\"intermediate\\">
<Leaf key=\\"leaf\\">
▾ <Wrapper key=\\"wrapper\\">"
" ▾ <Intermediate key="intermediate">
<Leaf key="leaf">
▾ <Wrapper key="wrapper">"
`);
});

Expand Down Expand Up @@ -217,9 +217,9 @@ describe('Store owners list', () => {
`);
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
" ▾ <Root>
<Leaf key=\\"A\\">
<Leaf key=\\"B\\">
<Leaf key=\\"C\\">"
<Leaf key="A">
<Leaf key="B">
<Leaf key="C">"
`);

act(() => legacyRender(<Root ascending={false} />, container));
Expand All @@ -232,9 +232,9 @@ describe('Store owners list', () => {
`);
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
" ▾ <Root>
<Leaf key=\\"C\\">
<Leaf key=\\"B\\">
<Leaf key=\\"A\\">"
<Leaf key="C">
<Leaf key="B">
<Leaf key="A">"
`);
});
});
Loading

0 comments on commit 3569831

Please sign in to comment.