Skip to content

Commit 3569831

Browse files
authored
Update jest escapeString config (#26140)
## Summary In jest v29, snapshotFormat default to escapeString: false(jestjs/jest#13036) ## How did you test this change? ci green
1 parent 6ddcbd4 commit 3569831

File tree

17 files changed

+242
-243
lines changed

17 files changed

+242
-243
lines changed

packages/react-devtools-shared/src/__tests__/inspectedElement-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2500,7 +2500,7 @@ describe('InspectedElement', () => {
25002500
Object {
25012501
"errors": Array [
25022502
Array [
2503-
"Warning: Each child in a list should have a unique \\"key\\" prop. See https://reactjs.org/link/warning-keys for more information.
2503+
"Warning: Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.
25042504
at Example",
25052505
1,
25062506
],

packages/react-devtools-shared/src/__tests__/profilingCharts-test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('profiling charts', () => {
125125
"actualDuration": 0,
126126
"didRender": true,
127127
"id": 5,
128-
"label": "Memo(Child) key=\\"third\\" (<0.1ms of <0.1ms)",
128+
"label": "Memo(Child) key="third" (<0.1ms of <0.1ms)",
129129
"name": "Memo(Child)",
130130
"offset": 15,
131131
"selfDuration": 0,
@@ -135,7 +135,7 @@ describe('profiling charts', () => {
135135
"actualDuration": 2,
136136
"didRender": true,
137137
"id": 4,
138-
"label": "Memo(Child) key=\\"second\\" (2ms of 2ms)",
138+
"label": "Memo(Child) key="second" (2ms of 2ms)",
139139
"name": "Memo(Child)",
140140
"offset": 13,
141141
"selfDuration": 2,
@@ -145,7 +145,7 @@ describe('profiling charts', () => {
145145
"actualDuration": 3,
146146
"didRender": true,
147147
"id": 3,
148-
"label": "Memo(Child) key=\\"first\\" (3ms of 3ms)",
148+
"label": "Memo(Child) key="first" (3ms of 3ms)",
149149
"name": "Memo(Child)",
150150
"offset": 10,
151151
"selfDuration": 3,
@@ -176,7 +176,7 @@ describe('profiling charts', () => {
176176
"actualDuration": 0,
177177
"didRender": false,
178178
"id": 5,
179-
"label": "Memo(Child) key=\\"third\\"",
179+
"label": "Memo(Child) key="third"",
180180
"name": "Memo(Child)",
181181
"offset": 15,
182182
"selfDuration": 0,
@@ -186,7 +186,7 @@ describe('profiling charts', () => {
186186
"actualDuration": 0,
187187
"didRender": false,
188188
"id": 4,
189-
"label": "Memo(Child) key=\\"second\\"",
189+
"label": "Memo(Child) key="second"",
190190
"name": "Memo(Child)",
191191
"offset": 13,
192192
"selfDuration": 0,
@@ -196,7 +196,7 @@ describe('profiling charts', () => {
196196
"actualDuration": 0,
197197
"didRender": false,
198198
"id": 3,
199-
"label": "Memo(Child) key=\\"first\\"",
199+
"label": "Memo(Child) key="first"",
200200
"name": "Memo(Child)",
201201
"offset": 10,
202202
"selfDuration": 0,
@@ -267,19 +267,19 @@ describe('profiling charts', () => {
267267
},
268268
Object {
269269
"id": 3,
270-
"label": "Memo(Child) (Memo) key=\\"first\\" (3ms)",
270+
"label": "Memo(Child) (Memo) key="first" (3ms)",
271271
"name": "Memo(Child)",
272272
"value": 3,
273273
},
274274
Object {
275275
"id": 4,
276-
"label": "Memo(Child) (Memo) key=\\"second\\" (2ms)",
276+
"label": "Memo(Child) (Memo) key="second" (2ms)",
277277
"name": "Memo(Child)",
278278
"value": 2,
279279
},
280280
Object {
281281
"id": 5,
282-
"label": "Memo(Child) (Memo) key=\\"third\\" (<0.1ms)",
282+
"label": "Memo(Child) (Memo) key="third" (<0.1ms)",
283283
"name": "Memo(Child)",
284284
"value": 0,
285285
},

packages/react-devtools-shared/src/__tests__/storeOwners-test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ describe('Store owners list', () => {
9494
const rootID = store.getElementIDAtIndex(0);
9595
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
9696
" ▾ <Root>
97-
▾ <Intermediate key=\\"intermediate\\">
97+
▾ <Intermediate key="intermediate">
9898
<Leaf>
99-
<Leaf key=\\"leaf\\">"
99+
<Leaf key="leaf">"
100100
`);
101101

102102
const intermediateID = store.getElementIDAtIndex(1);
103103
expect(getFormattedOwnersList(intermediateID)).toMatchInlineSnapshot(`
104-
" ▾ <Intermediate key=\\"intermediate\\">
105-
<Leaf key=\\"leaf\\">
106-
▾ <Wrapper key=\\"wrapper\\">"
104+
" ▾ <Intermediate key="intermediate">
105+
<Leaf key="leaf">
106+
▾ <Wrapper key="wrapper">"
107107
`);
108108
});
109109

@@ -217,9 +217,9 @@ describe('Store owners list', () => {
217217
`);
218218
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
219219
" ▾ <Root>
220-
<Leaf key=\\"A\\">
221-
<Leaf key=\\"B\\">
222-
<Leaf key=\\"C\\">"
220+
<Leaf key="A">
221+
<Leaf key="B">
222+
<Leaf key="C">"
223223
`);
224224

225225
act(() => legacyRender(<Root ascending={false} />, container));
@@ -232,9 +232,9 @@ describe('Store owners list', () => {
232232
`);
233233
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
234234
" ▾ <Root>
235-
<Leaf key=\\"C\\">
236-
<Leaf key=\\"B\\">
237-
<Leaf key=\\"A\\">"
235+
<Leaf key="C">
236+
<Leaf key="B">
237+
<Leaf key="A">"
238238
`);
239239
});
240240
});

0 commit comments

Comments
 (0)