Update jest escapeString config (#26140)
## Summary In jest v29, snapshotFormat default to escapeString: false(https://github.com/facebook/jest/pull/13036) ## How did you test this change? ci green
Ming Ye committed
Feb 10, 2023 at 07:08 UTC
35698311de3c068be9a542e1a2c545d718ec4782
17 files changed
+242
-243
packages/react-devtools-shared/src/__tests__/inspectedElement-test.js
+1
-1
@@ -2500,7 +2500,7 @@ describe('InspectedElement', () => {
2500
Object {
2501
"errors": Array [
2502
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.
2504
at Example",
2505
1,
2506
],
packages/react-devtools-shared/src/__tests__/profilingCharts-test.js
+9
-9
@@ -125,7 +125,7 @@ describe('profiling charts', () => {
125
"actualDuration": 0,
126
"didRender": true,
127
"id": 5,
128
- "label": "Memo(Child) key=\\"third\\" (<0.1ms of <0.1ms)",
128
+ "label": "Memo(Child) key="third" (<0.1ms of <0.1ms)",
129
"name": "Memo(Child)",
130
"offset": 15,
131
"selfDuration": 0,
@@ -135,7 +135,7 @@ describe('profiling charts', () => {
135
"actualDuration": 2,
136
"didRender": true,
137
"id": 4,
138
- "label": "Memo(Child) key=\\"second\\" (2ms of 2ms)",
138
+ "label": "Memo(Child) key="second" (2ms of 2ms)",
139
"name": "Memo(Child)",
140
"offset": 13,
141
"selfDuration": 2,
@@ -145,7 +145,7 @@ describe('profiling charts', () => {
145
"actualDuration": 3,
146
"didRender": true,
147
"id": 3,
148
- "label": "Memo(Child) key=\\"first\\" (3ms of 3ms)",
148
+ "label": "Memo(Child) key="first" (3ms of 3ms)",
149
"name": "Memo(Child)",
150
"offset": 10,
151
"selfDuration": 3,
@@ -176,7 +176,7 @@ describe('profiling charts', () => {
176
"actualDuration": 0,
177
"didRender": false,
178
"id": 5,
179
- "label": "Memo(Child) key=\\"third\\"",
179
+ "label": "Memo(Child) key="third"",
180
"name": "Memo(Child)",
181
"offset": 15,
182
"selfDuration": 0,
@@ -186,7 +186,7 @@ describe('profiling charts', () => {
186
"actualDuration": 0,
187
"didRender": false,
188
"id": 4,
189
- "label": "Memo(Child) key=\\"second\\"",
189
+ "label": "Memo(Child) key="second"",
190
"name": "Memo(Child)",
191
"offset": 13,
192
"selfDuration": 0,
@@ -196,7 +196,7 @@ describe('profiling charts', () => {
196
"actualDuration": 0,
197
"didRender": false,
198
"id": 3,
199
- "label": "Memo(Child) key=\\"first\\"",
199
+ "label": "Memo(Child) key="first"",
200
"name": "Memo(Child)",
201
"offset": 10,
202
"selfDuration": 0,
@@ -267,19 +267,19 @@ describe('profiling charts', () => {
267
},
268
Object {
269
"id": 3,
270
- "label": "Memo(Child) (Memo) key=\\"first\\" (3ms)",
270
+ "label": "Memo(Child) (Memo) key="first" (3ms)",
271
"name": "Memo(Child)",
272
"value": 3,
273
},
274
Object {
275
"id": 4,
276
- "label": "Memo(Child) (Memo) key=\\"second\\" (2ms)",
276
+ "label": "Memo(Child) (Memo) key="second" (2ms)",
277
"name": "Memo(Child)",
278
"value": 2,
279
},
280
Object {
281
"id": 5,
282
- "label": "Memo(Child) (Memo) key=\\"third\\" (<0.1ms)",
282
+ "label": "Memo(Child) (Memo) key="third" (<0.1ms)",
283
"name": "Memo(Child)",
284
"value": 0,
285
},
packages/react-devtools-shared/src/__tests__/storeOwners-test.js
+11
-11
@@ -94,16 +94,16 @@ describe('Store owners list', () => {
94
const rootID = store.getElementIDAtIndex(0);
95
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
96
" ▾ <Root>
97
- ▾ <Intermediate key=\\"intermediate\\">
97
+ ▾ <Intermediate key="intermediate">
98
<Leaf>
99
- <Leaf key=\\"leaf\\">"
99
+ <Leaf key="leaf">"
100
`);
101
102
const intermediateID = store.getElementIDAtIndex(1);
103
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">"
107
`);
108
});
109
@@ -217,9 +217,9 @@ describe('Store owners list', () => {
217
`);
218
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
219
" ▾ <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">"
223
`);
224
225
act(() => legacyRender(<Root ascending={false} />, container));
@@ -232,9 +232,9 @@ describe('Store owners list', () => {
232
`);
233
expect(getFormattedOwnersList(rootID)).toMatchInlineSnapshot(`
234
" ▾ <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">"
238
`);
239
});
240
});
packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js
+60
-60
@@ -262,58 +262,58 @@ describe('StoreStressConcurrent', () => {
262
Array [
263
"[root]
264
▾ <Root>
265
- <A key=\\"a\\">",
265
+ <A key="a">",
266
"[root]
267
▾ <Root>
268
- <B key=\\"b\\">",
268
+ <B key="b">",
269
"[root]
270
▾ <Root>
271
- <C key=\\"c\\">",
271
+ <C key="c">",
272
"[root]
273
▾ <Root>
274
- <D key=\\"d\\">",
274
+ <D key="d">",
275
"[root]
276
▾ <Root>
277
- <E key=\\"e\\">",
277
+ <E key="e">",
278
"[root]
279
▾ <Root>
280
- <A key=\\"a\\">",
280
+ <A key="a">",
281
"[root]
282
▾ <Root>
283
- <B key=\\"b\\">",
283
+ <B key="b">",
284
"[root]
285
▾ <Root>
286
- <C key=\\"c\\">",
286
+ <C key="c">",
287
"[root]
288
▾ <Root>
289
- <D key=\\"d\\">",
289
+ <D key="d">",
290
"[root]
291
▾ <Root>
292
- <E key=\\"e\\">",
292
+ <E key="e">",
293
"[root]
294
▾ <Root>
295
- <A key=\\"a\\">
296
- <B key=\\"b\\">",
295
+ <A key="a">
296
+ <B key="b">",
297
"[root]
298
▾ <Root>
299
- <B key=\\"b\\">
300
- <A key=\\"a\\">",
299
+ <B key="b">
300
+ <A key="a">",
301
"[root]
302
▾ <Root>
303
- <B key=\\"b\\">
304
- <C key=\\"c\\">",
303
+ <B key="b">
304
+ <C key="c">",
305
"[root]
306
▾ <Root>
307
- <C key=\\"c\\">
308
- <B key=\\"b\\">",
307
+ <C key="c">
308
+ <B key="b">",
309
"[root]
310
▾ <Root>
311
- <A key=\\"a\\">
312
- <C key=\\"c\\">",
311
+ <A key="a">
312
+ <C key="c">",
313
"[root]
314
▾ <Root>
315
- <C key=\\"c\\">
316
- <A key=\\"a\\">",
315
+ <C key="c">
316
+ <A key="a">",
317
]
318
`);
319
@@ -435,63 +435,63 @@ describe('StoreStressConcurrent', () => {
435
▾ <Root>
436
<X>
437
▾ <Suspense>
438
- <A key=\\"a\\">
438
+ <A key="a">
439
<Y>",
440
"[root]
441
▾ <Root>
442
<X>
443
▾ <Suspense>
444
- <A key=\\"a\\">
444
+ <A key="a">
445
<Y>",
446
"[root]
447
▾ <Root>
448
<X>
449
▾ <Suspense>
450
- <A key=\\"a\\">
451
- <B key=\\"b\\">
452
- <C key=\\"c\\">
450
+ <A key="a">
451
+ <B key="b">
452
+ <C key="c">
453
<Y>",
454
"[root]
455
▾ <Root>
456
<X>
457
▾ <Suspense>
458
- <C key=\\"c\\">
459
- <B key=\\"b\\">
460
- <A key=\\"a\\">
458
+ <C key="c">
459
+ <B key="b">
460
+ <A key="a">
461
<Y>",
462
"[root]
463
▾ <Root>
464
<X>
465
▾ <Suspense>
466
- <C key=\\"c\\">
467
- <A key=\\"a\\">
466
+ <C key="c">
467
+ <A key="a">
468
<Y>",
469
"[root]
470
▾ <Root>
471
<X>
472
▾ <Suspense>
473
- <C key=\\"c\\">
474
- <A key=\\"a\\">
473
+ <C key="c">
474
+ <A key="a">
475
<Y>",
476
"[root]
477
▾ <Root>
478
<X>
479
▾ <Suspense>
480
- <C key=\\"c\\">
481
- <A key=\\"a\\">
480
+ <C key="c">
481
+ <A key="a">
482
<Y>",
483
"[root]
484
▾ <Root>
485
<X>
486
▾ <Suspense>
487
- <A key=\\"a\\">
488
- <B key=\\"b\\">
487
+ <A key="a">
488
+ <B key="b">
489
<Y>",
490
"[root]
491
▾ <Root>
492
<X>
493
▾ <Suspense>
494
- <A key=\\"a\\">
494
+ <A key="a">
495
<Y>",
496
"[root]
497
▾ <Root>
@@ -502,13 +502,13 @@ describe('StoreStressConcurrent', () => {
502
▾ <Root>
503
<X>
504
▾ <Suspense>
505
- <B key=\\"b\\">
505
+ <B key="b">
506
<Y>",
507
"[root]
508
▾ <Root>
509
<X>
510
▾ <Suspense>
511
- <A key=\\"a\\">
511
+ <A key="a">
512
<Y>",
513
]
514
`);
@@ -956,7 +956,7 @@ describe('StoreStressConcurrent', () => {
956
<X>
957
▾ <Suspense>
958
▾ <MaybeSuspend>
959
- <A key=\\"a\\">
959
+ <A key="a">
960
<Z>
961
<Y>",
962
"[root]
@@ -964,7 +964,7 @@ describe('StoreStressConcurrent', () => {
964
<X>
965
▾ <Suspense>
966
▾ <MaybeSuspend>
967
- <A key=\\"a\\">
967
+ <A key="a">
968
<Z>
969
<Y>",
970
"[root]
@@ -972,9 +972,9 @@ describe('StoreStressConcurrent', () => {
972
<X>
973
▾ <Suspense>
974
▾ <MaybeSuspend>
975
- <A key=\\"a\\">
976
- <B key=\\"b\\">
977
- <C key=\\"c\\">
975
+ <A key="a">
976
+ <B key="b">
977
+ <C key="c">
978
<Z>
979
<Y>",
980
"[root]
@@ -982,9 +982,9 @@ describe('StoreStressConcurrent', () => {
982
<X>
983
▾ <Suspense>
984
▾ <MaybeSuspend>
985
- <C key=\\"c\\">
986
- <B key=\\"b\\">
987
- <A key=\\"a\\">
985
+ <C key="c">
986
+ <B key="b">
987
+ <A key="a">
988
<Z>
989
<Y>",
990
"[root]
@@ -992,8 +992,8 @@ describe('StoreStressConcurrent', () => {
992
<X>
993
▾ <Suspense>
994
▾ <MaybeSuspend>
995
- <C key=\\"c\\">
996
- <A key=\\"a\\">
995
+ <C key="c">
996
+ <A key="a">
997
<Z>
998
<Y>",
999
"[root]
@@ -1001,8 +1001,8 @@ describe('StoreStressConcurrent', () => {
1001
<X>
1002
▾ <Suspense>
1003
▾ <MaybeSuspend>
1004
- <C key=\\"c\\">
1005
- <A key=\\"a\\">
1004
+ <C key="c">
1005
+ <A key="a">
1006
<Z>
1007
<Y>",
1008
"[root]
@@ -1010,8 +1010,8 @@ describe('StoreStressConcurrent', () => {
1010
<X>
1011
▾ <Suspense>
1012
▾ <MaybeSuspend>
1013
- <C key=\\"c\\">
1014
- <A key=\\"a\\">
1013
+ <C key="c">
1014
+ <A key="a">
1015
<Z>
1016
<Y>",
1017
"[root]
@@ -1019,8 +1019,8 @@ describe('StoreStressConcurrent', () => {
1019
<X>
1020
▾ <Suspense>
1021
▾ <MaybeSuspend>
1022
- <A key=\\"a\\">
1023
- <B key=\\"b\\">
1022
+ <A key="a">
1023
+ <B key="b">
1024
<Z>
1025
<Y>",
1026
"[root]
@@ -1028,7 +1028,7 @@ describe('StoreStressConcurrent', () => {
1028
<X>
1029
▾ <Suspense>
1030
▾ <MaybeSuspend>
1031
- <A key=\\"a\\">
1031
+ <A key="a">
1032
<Z>
1033
<Y>",
1034
"[root]
@@ -1043,7 +1043,7 @@ describe('StoreStressConcurrent', () => {
1043
<X>
1044
▾ <Suspense>
1045
▾ <MaybeSuspend>
1046
- <B key=\\"b\\">
1046
+ <B key="b">
1047
<Z>
1048
<Y>",
1049
"[root]
@@ -1051,7 +1051,7 @@ describe('StoreStressConcurrent', () => {
1051
<X>
1052
▾ <Suspense>
1053
▾ <MaybeSuspend>
1054
- <A key=\\"a\\">
1054
+ <A key="a">
1055
<Z>
1056
<Y>",
1057
]
packages/react-dom/src/__tests__/ReactDOMFizzServerBrowser-test.js
+1
-1
@@ -78,7 +78,7 @@ describe('ReactDOMFizzServerBrowser', () => {
78
);
79
const result = await readResult(stream);
80
expect(result).toMatchInlineSnapshot(
81
- `"<div>hello world</div><script>INIT();</script><script src=\\"init.js\\" async=\\"\\"></script><script type=\\"module\\" src=\\"init.mjs\\" async=\\"\\"></script>"`,
81
+ `"<div>hello world</div><script>INIT();</script><script src="init.js" async=""></script><script type="module" src="init.mjs" async=""></script>"`,
82
);
83
});
84
packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
+1
-1
@@ -91,7 +91,7 @@ describe('ReactDOMFizzServerNode', () => {
91
pipe(writable);
92
jest.runAllTimers();
93
expect(output.result).toMatchInlineSnapshot(
94
- `"<div>hello world</div><script>INIT();</script><script src=\\"init.js\\" async=\\"\\"></script><script type=\\"module\\" src=\\"init.mjs\\" async=\\"\\"></script>"`,
94
+ `"<div>hello world</div><script>INIT();</script><script src="init.js" async=""></script><script type="module" src="init.mjs" async=""></script>"`,
95
);
96
});
97
packages/react-dom/src/__tests__/ReactDOMFizzStaticBrowser-test.js
+1
-1
@@ -78,7 +78,7 @@ describe('ReactDOMFizzStaticBrowser', () => {
78
});
79
const prelude = await readContent(result.prelude);
80
expect(prelude).toMatchInlineSnapshot(
81
- `"<div>hello world</div><script>INIT();</script><script src=\\"init.js\\" async=\\"\\"></script><script type=\\"module\\" src=\\"init.mjs\\" async=\\"\\"></script>"`,
81
+ `"<div>hello world</div><script>INIT();</script><script src="init.js" async=""></script><script type="module" src="init.mjs" async=""></script>"`,
82
);
83
});
84
packages/react-dom/src/__tests__/ReactDOMFizzStaticNode-test.js
+1
-1
@@ -80,7 +80,7 @@ describe('ReactDOMFizzStaticNode', () => {
80
);
81
const prelude = await readContent(result.prelude);
82
expect(prelude).toMatchInlineSnapshot(
83
- `"<div>hello world</div><script>INIT();</script><script src=\\"init.js\\" async=\\"\\"></script><script type=\\"module\\" src=\\"init.mjs\\" async=\\"\\"></script>"`,
83
+ `"<div>hello world</div><script>INIT();</script><script src="init.js" async=""></script><script type="module" src="init.mjs" async=""></script>"`,
84
);
85
});
86
packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js
+16
-16
@@ -92,7 +92,7 @@ describe('ReactDOMServerHydration', () => {
92
if (gate(flags => flags.enableClientRenderFallbackOnTextMismatch)) {
93
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
94
Array [
95
- "Warning: Text content did not match. Server: \\"server\\" Client: \\"client\\"
95
+ "Warning: Text content did not match. Server: "server" Client: "client"
96
in main (at **)
97
in div (at **)
98
in Mismatch (at **)",
@@ -104,7 +104,7 @@ describe('ReactDOMServerHydration', () => {
104
} else {
105
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
106
Array [
107
- "Warning: Text content did not match. Server: \\"server\\" Client: \\"client\\"
107
+ "Warning: Text content did not match. Server: "server" Client: "client"
108
in main (at **)
109
in div (at **)
110
in Mismatch (at **)",
@@ -131,7 +131,7 @@ describe('ReactDOMServerHydration', () => {
131
}
132
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
133
Array [
134
- "Warning: Prop \`dangerouslySetInnerHTML\` did not match. Server: \\"<span>server</span>\\" Client: \\"<span>client</span>\\"
134
+ "Warning: Prop \`dangerouslySetInnerHTML\` did not match. Server: "<span>server</span>" Client: "<span>client</span>"
135
in main (at **)
136
in div (at **)
137
in Mismatch (at **)",
@@ -155,7 +155,7 @@ describe('ReactDOMServerHydration', () => {
155
}
156
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
157
Array [
158
- "Warning: Prop \`className\` did not match. Server: \\"child server\\" Client: \\"child client\\"
158
+ "Warning: Prop \`className\` did not match. Server: "child server" Client: "child client"
159
in main (at **)
160
in div (at **)
161
in Mismatch (at **)",
@@ -178,7 +178,7 @@ describe('ReactDOMServerHydration', () => {
178
}
179
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
180
Array [
181
- "Warning: Prop \`tabIndex\` did not match. Server: \\"null\\" Client: \\"1\\"
181
+ "Warning: Prop \`tabIndex\` did not match. Server: "null" Client: "1"
182
in main (at **)
183
in div (at **)
184
in Mismatch (at **)",
@@ -224,7 +224,7 @@ describe('ReactDOMServerHydration', () => {
224
}
225
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
226
Array [
227
- "Warning: Prop \`tabIndex\` did not match. Server: \\"null\\" Client: \\"1\\"
227
+ "Warning: Prop \`tabIndex\` did not match. Server: "null" Client: "1"
228
in main (at **)
229
in div (at **)
230
in Mismatch (at **)",
@@ -248,7 +248,7 @@ describe('ReactDOMServerHydration', () => {
248
}
249
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
250
Array [
251
- "Warning: Prop \`style\` did not match. Server: \\"opacity:0\\" Client: \\"opacity:1\\"
251
+ "Warning: Prop \`style\` did not match. Server: "opacity:0" Client: "opacity:1"
252
in main (at **)
253
in div (at **)
254
in Mismatch (at **)",
@@ -363,7 +363,7 @@ describe('ReactDOMServerHydration', () => {
363
if (gate(flags => flags.enableClientRenderFallbackOnTextMismatch)) {
364
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
365
Array [
366
- "Warning: Text content did not match. Server: \\"\\" Client: \\"only\\"
366
+ "Warning: Text content did not match. Server: "" Client: "only"
367
in div (at **)
368
in Mismatch (at **)",
369
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -374,7 +374,7 @@ describe('ReactDOMServerHydration', () => {
374
} else {
375
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
376
Array [
377
- "Warning: Text content did not match. Server: \\"\\" Client: \\"only\\"
377
+ "Warning: Text content did not match. Server: "" Client: "only"
378
in div (at **)
379
in Mismatch (at **)",
380
]
@@ -395,7 +395,7 @@ describe('ReactDOMServerHydration', () => {
395
}
396
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
397
Array [
398
- "Warning: Expected server HTML to contain a matching text node for \\"second\\" in <div>.
398
+ "Warning: Expected server HTML to contain a matching text node for "second" in <div>.
399
in div (at **)
400
in Mismatch (at **)",
401
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -418,7 +418,7 @@ describe('ReactDOMServerHydration', () => {
418
}
419
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
420
Array [
421
- "Warning: Expected server HTML to contain a matching text node for \\"first\\" in <div>.
421
+ "Warning: Expected server HTML to contain a matching text node for "first" in <div>.
422
in div (at **)
423
in Mismatch (at **)",
424
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -441,7 +441,7 @@ describe('ReactDOMServerHydration', () => {
441
}
442
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
443
Array [
444
- "Warning: Expected server HTML to contain a matching text node for \\"third\\" in <div>.
444
+ "Warning: Expected server HTML to contain a matching text node for "third" in <div>.
445
in div (at **)
446
in Mismatch (at **)",
447
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -557,7 +557,7 @@ describe('ReactDOMServerHydration', () => {
557
}
558
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
559
Array [
560
- "Warning: Did not expect server HTML to contain the text node \\"only\\" in <div>.
560
+ "Warning: Did not expect server HTML to contain the text node "only" in <div>.
561
in div (at **)
562
in Mismatch (at **)",
563
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -629,7 +629,7 @@ describe('ReactDOMServerHydration', () => {
629
}
630
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
631
Array [
632
- "Warning: Did not expect server HTML to contain the text node \\"third\\" in <div>.
632
+ "Warning: Did not expect server HTML to contain the text node "third" in <div>.
633
in div (at **)
634
in Mismatch (at **)",
635
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
@@ -823,7 +823,7 @@ describe('ReactDOMServerHydration', () => {
823
824
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
825
Array [
826
- "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
826
+ "Caught [The server did not finish this Suspense boundary: The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server]",
827
]
828
`);
829
});
@@ -849,7 +849,7 @@ describe('ReactDOMServerHydration', () => {
849
850
expect(testMismatch(Mismatch)).toMatchInlineSnapshot(`
851
Array [
852
- "Caught [The server did not finish this Suspense boundary: The server used \\"renderToString\\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \\"renderToPipeableStream\\" which supports Suspense on the server]",
852
+ "Caught [The server did not finish this Suspense boundary: The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server]",
853
]
854
`);
855
});
packages/react-native-renderer/src/__tests__/__snapshots__/ReactFabric-test.internal.js.snap
+86
-86
@@ -4,119 +4,119 @@ exports[`ReactFabric recreates host parents even if only children changed 1`] =
4
"11
5
RCTView null
6
RCTView null
7
- RCTView {\\"title\\":\\"a\\"}
8
- RCTView {\\"title\\":\\"b\\"}
9
- RCTView {\\"title\\":\\"c\\"}
10
- RCTView {\\"title\\":\\"d\\"}
11
- RCTView {\\"title\\":\\"e\\"}
12
- RCTView {\\"title\\":\\"f\\"}
13
- RCTView {\\"title\\":\\"g\\"}
14
- RCTView {\\"title\\":\\"h\\"}
15
- RCTView {\\"title\\":\\"i\\"}
16
- RCTView {\\"title\\":\\"j\\"}
17
- RCTView {\\"title\\":\\"k\\"}
18
- RCTView {\\"title\\":\\"l\\"}
19
- RCTView {\\"title\\":\\"m\\"}
20
- RCTView {\\"title\\":\\"n\\"}
21
- RCTView {\\"title\\":\\"o\\"}
22
- RCTView {\\"title\\":\\"p\\"}
23
- RCTView {\\"title\\":\\"q\\"}
24
- RCTView {\\"title\\":\\"r\\"}
25
- RCTView {\\"title\\":\\"s\\"}
26
- RCTView {\\"title\\":\\"t\\"}"
7
+ RCTView {"title":"a"}
8
+ RCTView {"title":"b"}
9
+ RCTView {"title":"c"}
10
+ RCTView {"title":"d"}
11
+ RCTView {"title":"e"}
12
+ RCTView {"title":"f"}
13
+ RCTView {"title":"g"}
14
+ RCTView {"title":"h"}
15
+ RCTView {"title":"i"}
16
+ RCTView {"title":"j"}
17
+ RCTView {"title":"k"}
18
+ RCTView {"title":"l"}
19
+ RCTView {"title":"m"}
20
+ RCTView {"title":"n"}
21
+ RCTView {"title":"o"}
22
+ RCTView {"title":"p"}
23
+ RCTView {"title":"q"}
24
+ RCTView {"title":"r"}
25
+ RCTView {"title":"s"}
26
+ RCTView {"title":"t"}"
27
`;
28
29
exports[`ReactFabric recreates host parents even if only children changed 2`] = `
30
"11
31
RCTView null
32
RCTView null
33
- RCTView {\\"title\\":\\"m\\"}
34
- RCTView {\\"title\\":\\"x\\"}
35
- RCTView {\\"title\\":\\"h\\"}
36
- RCTView {\\"title\\":\\"p\\"}
37
- RCTView {\\"title\\":\\"g\\"}
38
- RCTView {\\"title\\":\\"w\\"}
39
- RCTView {\\"title\\":\\"f\\"}
40
- RCTView {\\"title\\":\\"r\\"}
41
- RCTView {\\"title\\":\\"a\\"}
42
- RCTView {\\"title\\":\\"l\\"}
43
- RCTView {\\"title\\":\\"k\\"}
44
- RCTView {\\"title\\":\\"e\\"}
45
- RCTView {\\"title\\":\\"o\\"}
46
- RCTView {\\"title\\":\\"i\\"}
47
- RCTView {\\"title\\":\\"v\\"}
48
- RCTView {\\"title\\":\\"c\\"}
49
- RCTView {\\"title\\":\\"s\\"}
50
- RCTView {\\"title\\":\\"t\\"}
51
- RCTView {\\"title\\":\\"z\\"}
52
- RCTView {\\"title\\":\\"y\\"}"
33
+ RCTView {"title":"m"}
34
+ RCTView {"title":"x"}
35
+ RCTView {"title":"h"}
36
+ RCTView {"title":"p"}
37
+ RCTView {"title":"g"}
38
+ RCTView {"title":"w"}
39
+ RCTView {"title":"f"}
40
+ RCTView {"title":"r"}
41
+ RCTView {"title":"a"}
42
+ RCTView {"title":"l"}
43
+ RCTView {"title":"k"}
44
+ RCTView {"title":"e"}
45
+ RCTView {"title":"o"}
46
+ RCTView {"title":"i"}
47
+ RCTView {"title":"v"}
48
+ RCTView {"title":"c"}
49
+ RCTView {"title":"s"}
50
+ RCTView {"title":"t"}
51
+ RCTView {"title":"z"}
52
+ RCTView {"title":"y"}"
53
`;
54
55
exports[`ReactFabric renders and reorders children 1`] = `
56
"11
57
RCTView null
58
- RCTView {\\"title\\":\\"a\\"}
59
- RCTView {\\"title\\":\\"b\\"}
60
- RCTView {\\"title\\":\\"c\\"}
61
- RCTView {\\"title\\":\\"d\\"}
62
- RCTView {\\"title\\":\\"e\\"}
63
- RCTView {\\"title\\":\\"f\\"}
64
- RCTView {\\"title\\":\\"g\\"}
65
- RCTView {\\"title\\":\\"h\\"}
66
- RCTView {\\"title\\":\\"i\\"}
67
- RCTView {\\"title\\":\\"j\\"}
68
- RCTView {\\"title\\":\\"k\\"}
69
- RCTView {\\"title\\":\\"l\\"}
70
- RCTView {\\"title\\":\\"m\\"}
71
- RCTView {\\"title\\":\\"n\\"}
72
- RCTView {\\"title\\":\\"o\\"}
73
- RCTView {\\"title\\":\\"p\\"}
74
- RCTView {\\"title\\":\\"q\\"}
75
- RCTView {\\"title\\":\\"r\\"}
76
- RCTView {\\"title\\":\\"s\\"}
77
- RCTView {\\"title\\":\\"t\\"}"
58
+ RCTView {"title":"a"}
59
+ RCTView {"title":"b"}
60
+ RCTView {"title":"c"}
61
+ RCTView {"title":"d"}
62
+ RCTView {"title":"e"}
63
+ RCTView {"title":"f"}
64
+ RCTView {"title":"g"}
65
+ RCTView {"title":"h"}
66
+ RCTView {"title":"i"}
67
+ RCTView {"title":"j"}
68
+ RCTView {"title":"k"}
69
+ RCTView {"title":"l"}
70
+ RCTView {"title":"m"}
71
+ RCTView {"title":"n"}
72
+ RCTView {"title":"o"}
73
+ RCTView {"title":"p"}
74
+ RCTView {"title":"q"}
75
+ RCTView {"title":"r"}
76
+ RCTView {"title":"s"}
77
+ RCTView {"title":"t"}"
78
`;
79
80
exports[`ReactFabric renders and reorders children 2`] = `
81
"11
82
RCTView null
83
- RCTView {\\"title\\":\\"m\\"}
84
- RCTView {\\"title\\":\\"x\\"}
85
- RCTView {\\"title\\":\\"h\\"}
86
- RCTView {\\"title\\":\\"p\\"}
87
- RCTView {\\"title\\":\\"g\\"}
88
- RCTView {\\"title\\":\\"w\\"}
89
- RCTView {\\"title\\":\\"f\\"}
90
- RCTView {\\"title\\":\\"r\\"}
91
- RCTView {\\"title\\":\\"a\\"}
92
- RCTView {\\"title\\":\\"l\\"}
93
- RCTView {\\"title\\":\\"k\\"}
94
- RCTView {\\"title\\":\\"e\\"}
95
- RCTView {\\"title\\":\\"o\\"}
96
- RCTView {\\"title\\":\\"i\\"}
97
- RCTView {\\"title\\":\\"v\\"}
98
- RCTView {\\"title\\":\\"c\\"}
99
- RCTView {\\"title\\":\\"s\\"}
100
- RCTView {\\"title\\":\\"t\\"}
101
- RCTView {\\"title\\":\\"z\\"}
102
- RCTView {\\"title\\":\\"y\\"}"
83
+ RCTView {"title":"m"}
84
+ RCTView {"title":"x"}
85
+ RCTView {"title":"h"}
86
+ RCTView {"title":"p"}
87
+ RCTView {"title":"g"}
88
+ RCTView {"title":"w"}
89
+ RCTView {"title":"f"}
90
+ RCTView {"title":"r"}
91
+ RCTView {"title":"a"}
92
+ RCTView {"title":"l"}
93
+ RCTView {"title":"k"}
94
+ RCTView {"title":"e"}
95
+ RCTView {"title":"o"}
96
+ RCTView {"title":"i"}
97
+ RCTView {"title":"v"}
98
+ RCTView {"title":"c"}
99
+ RCTView {"title":"s"}
100
+ RCTView {"title":"t"}
101
+ RCTView {"title":"z"}
102
+ RCTView {"title":"y"}"
103
`;
104
105
exports[`ReactFabric should call complete after inserting children 1`] = `
106
Array [
107
- "RCTView {\\"foo\\":\\"a\\"}
108
- RCTView {\\"foo\\":\\"b\\"}",
107
+ "RCTView {"foo":"a"}
108
+ RCTView {"foo":"b"}",
109
]
110
`;
111
112
exports[`ReactFabric should only pass props diffs to FabricUIManager.cloneNode 1`] = `
113
"11
114
- RCTText {\\"foo\\":\\"a\\",\\"bar\\":\\"b\\"}
115
- RCTRawText {\\"text\\":\\"1\\"}"
114
+ RCTText {"foo":"a","bar":"b"}
115
+ RCTRawText {"text":"1"}"
116
`;
117
118
exports[`ReactFabric should only pass props diffs to FabricUIManager.cloneNode 2`] = `
119
"11
120
- RCTText {\\"foo\\":\\"b\\",\\"bar\\":\\"b\\"}
121
- RCTRawText {\\"text\\":\\"2\\"}"
120
+ RCTText {"foo":"b","bar":"b"}
121
+ RCTRawText {"text":"2"}"
122
`;
packages/react-native-renderer/src/__tests__/__snapshots__/ReactNativeEvents-test.internal.js.snap
+2
-2
@@ -7,6 +7,6 @@ exports[`fails if unknown/unsupported event types are dispatched 1`] = `
7
8
exports[`handles events 1`] = `
9
"<native root> {}
10
- View {\\"foo\\":\\"outer\\"}
11
- View {\\"foo\\":\\"inner\\"}"
10
+ View {"foo":"outer"}
11
+ View {"foo":"inner"}"
12
`;
packages/react-native-renderer/src/__tests__/__snapshots__/ReactNativeMount-test.internal.js.snap
+40
-40
@@ -3,49 +3,49 @@
3
exports[`ReactNative renders and reorders children 1`] = `
4
"<native root> {}
5
RCTView null
6
- RCTView {\\"title\\":\\"a\\"}
7
- RCTView {\\"title\\":\\"b\\"}
8
- RCTView {\\"title\\":\\"c\\"}
9
- RCTView {\\"title\\":\\"d\\"}
10
- RCTView {\\"title\\":\\"e\\"}
11
- RCTView {\\"title\\":\\"f\\"}
12
- RCTView {\\"title\\":\\"g\\"}
13
- RCTView {\\"title\\":\\"h\\"}
14
- RCTView {\\"title\\":\\"i\\"}
15
- RCTView {\\"title\\":\\"j\\"}
16
- RCTView {\\"title\\":\\"k\\"}
17
- RCTView {\\"title\\":\\"l\\"}
18
- RCTView {\\"title\\":\\"m\\"}
19
- RCTView {\\"title\\":\\"n\\"}
20
- RCTView {\\"title\\":\\"o\\"}
21
- RCTView {\\"title\\":\\"p\\"}
22
- RCTView {\\"title\\":\\"q\\"}
23
- RCTView {\\"title\\":\\"r\\"}
24
- RCTView {\\"title\\":\\"s\\"}
25
- RCTView {\\"title\\":\\"t\\"}"
6
+ RCTView {"title":"a"}
7
+ RCTView {"title":"b"}
8
+ RCTView {"title":"c"}
9
+ RCTView {"title":"d"}
10
+ RCTView {"title":"e"}
11
+ RCTView {"title":"f"}
12
+ RCTView {"title":"g"}
13
+ RCTView {"title":"h"}
14
+ RCTView {"title":"i"}
15
+ RCTView {"title":"j"}
16
+ RCTView {"title":"k"}
17
+ RCTView {"title":"l"}
18
+ RCTView {"title":"m"}
19
+ RCTView {"title":"n"}
20
+ RCTView {"title":"o"}
21
+ RCTView {"title":"p"}
22
+ RCTView {"title":"q"}
23
+ RCTView {"title":"r"}
24
+ RCTView {"title":"s"}
25
+ RCTView {"title":"t"}"
26
`;
27
28
exports[`ReactNative renders and reorders children 2`] = `
29
"<native root> {}
30
RCTView null
31
- RCTView {\\"title\\":\\"m\\"}
32
- RCTView {\\"title\\":\\"x\\"}
33
- RCTView {\\"title\\":\\"h\\"}
34
- RCTView {\\"title\\":\\"p\\"}
35
- RCTView {\\"title\\":\\"g\\"}
36
- RCTView {\\"title\\":\\"w\\"}
37
- RCTView {\\"title\\":\\"f\\"}
38
- RCTView {\\"title\\":\\"r\\"}
39
- RCTView {\\"title\\":\\"a\\"}
40
- RCTView {\\"title\\":\\"l\\"}
41
- RCTView {\\"title\\":\\"k\\"}
42
- RCTView {\\"title\\":\\"e\\"}
43
- RCTView {\\"title\\":\\"o\\"}
44
- RCTView {\\"title\\":\\"i\\"}
45
- RCTView {\\"title\\":\\"v\\"}
46
- RCTView {\\"title\\":\\"c\\"}
47
- RCTView {\\"title\\":\\"s\\"}
48
- RCTView {\\"title\\":\\"t\\"}
49
- RCTView {\\"title\\":\\"z\\"}
50
- RCTView {\\"title\\":\\"y\\"}"
31
+ RCTView {"title":"m"}
32
+ RCTView {"title":"x"}
33
+ RCTView {"title":"h"}
34
+ RCTView {"title":"p"}
35
+ RCTView {"title":"g"}
36
+ RCTView {"title":"w"}
37
+ RCTView {"title":"f"}
38
+ RCTView {"title":"r"}
39
+ RCTView {"title":"a"}
40
+ RCTView {"title":"l"}
41
+ RCTView {"title":"k"}
42
+ RCTView {"title":"e"}
43
+ RCTView {"title":"o"}
44
+ RCTView {"title":"i"}
45
+ RCTView {"title":"v"}
46
+ RCTView {"title":"c"}
47
+ RCTView {"title":"s"}
48
+ RCTView {"title":"t"}
49
+ RCTView {"title":"z"}
50
+ RCTView {"title":"y"}"
51
`;
packages/react-server-dom-relay/src/__tests__/ReactDOMServerFB-test.internal.js
+1
-1
@@ -59,7 +59,7 @@ describe('ReactDOMServerFB', () => {
59
});
60
const result = readResult(stream);
61
expect(result).toMatchInlineSnapshot(
62
- `"<div>hello world</div><script>INIT();</script><script src=\\"init.js\\" async=\\"\\"></script><script type=\\"module\\" src=\\"init.mjs\\" async=\\"\\"></script>"`,
62
+ `"<div>hello world</div><script>INIT();</script><script src="init.js" async=""></script><script type="module" src="init.mjs" async=""></script>"`,
63
);
64
});
65
packages/react-server-native-relay/src/__tests__/__snapshots__/ReactFlightNativeRelay-test.internal.js.snap
+3
-3
@@ -3,9 +3,9 @@
3
exports[`ReactFlightNativeRelay can render a Client Component using a module reference and render there 1`] = `
4
"1
5
RCTText null
6
- RCTRawText {\\"text\\":\\"Hello\\"}
7
- RCTRawText {\\"text\\":\\", \\"}
8
- RCTRawText {\\"text\\":\\"Seb Smith\\"}"
6
+ RCTRawText {"text":"Hello"}
7
+ RCTRawText {"text":", "}
8
+ RCTRawText {"text":"Seb Smith"}"
9
`;
10
11
exports[`ReactFlightNativeRelay can render a Server Component 1`] = `
packages/react/src/__tests__/ReactFetch-test.js
+1
-1
@@ -183,7 +183,7 @@ describe('ReactFetch', () => {
183
return text + ' ' + text2;
184
}
185
expect(await render(Component)).toMatchInlineSnapshot(
186
- `"GET world [[\\"a\\",\\"A\\"]] GET world [[\\"b\\",\\"B\\"]]"`,
186
+ `"GET world [["a","A"]] GET world [["b","B"]]"`,
187
);
188
expect(fetchCount).toBe(2);
189
});
scripts/error-codes/__tests__/__snapshots__/transform-error-messages.js.snap
+8
-8
@@ -11,14 +11,14 @@ b, new Error('foo')));"
11
`;
12
13
exports[`error transform handles escaped backticks in template string 1`] = `
14
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
14
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
15
Error(_formatProdErrorMessage(231, listener, type));"
16
`;
17
18
exports[`error transform handles ignoring errors that are comment-excluded inside ternary expressions 1`] = `
19
"/*! FIXME (minify-errors-in-prod): Unminified error message in production build!*/
20
21
-/*! <expected-error-format>\\"bar\\"</expected-error-format>*/
21
+/*! <expected-error-format>"bar"</expected-error-format>*/
22
var val = someBool ? //eslint-disable-next-line react-internal/prod-error-codes
23
new Error('foo') : someOtherBool ? new Error('bar') : //eslint-disable-next-line react-internal/prod-error-codes
24
new Error('baz');"
@@ -37,7 +37,7 @@ NotAnError();"
37
exports[`error transform should output FIXME for errors that don't have a matching error code 1`] = `
38
"/*! FIXME (minify-errors-in-prod): Unminified error message in production build!*/
39
40
-/*! <expected-error-format>\\"This is not a real error message.\\"</expected-error-format>*/
40
+/*! <expected-error-format>"This is not a real error message."</expected-error-format>*/
41
Error('This is not a real error message.');"
42
`;
43
@@ -47,26 +47,26 @@ Error('This is not a real error message.');"
47
`;
48
49
exports[`error transform should replace error constructors (no new) 1`] = `
50
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
50
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
51
Error(_formatProdErrorMessage(16));"
52
`;
53
54
exports[`error transform should replace error constructors 1`] = `
55
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
55
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
56
Error(_formatProdErrorMessage(16));"
57
`;
58
59
exports[`error transform should support error constructors with concatenated messages 1`] = `
60
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
60
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
61
Error(_formatProdErrorMessage(7, foo, bar));"
62
`;
63
64
exports[`error transform should support interpolating arguments with concatenation 1`] = `
65
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
65
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
66
Error(_formatProdErrorMessage(7, foo, bar));"
67
`;
68
69
exports[`error transform should support interpolating arguments with template strings 1`] = `
70
-"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
70
+"import _formatProdErrorMessage from "shared/formatProdErrorMessage";
71
Error(_formatProdErrorMessage(7, foo, bar));"
72
`;
scripts/jest/config.base.js
-1
@@ -25,7 +25,6 @@ module.exports = {
25
legacyFakeTimers: true,
26
},
27
snapshotFormat: {
28
- escapeString: true,
28
printBasicPrototype: true,
29
},
30
snapshotSerializers: [require.resolve('jest-snapshot-serializer-raw')],