-
Notifications
You must be signed in to change notification settings - Fork 45.6k
/
transform-error-messages.js.snap
72 lines (57 loc) · 2.98 KB
/
transform-error-messages.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`error transform handles deeply nested expressions 1`] = `
"var val = (a, (b, // eslint-disable-next-line react-internal/prod-error-codes
new Error('foo')));"
`;
exports[`error transform handles deeply nested expressions 2`] = `
"var val = (a, ( // eslint-disable-next-line react-internal/prod-error-codes
b, new Error('foo')));"
`;
exports[`error transform handles escaped backticks in template string 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(231, listener, type));"
`;
exports[`error transform handles ignoring errors that are comment-excluded inside ternary expressions 1`] = `
"/*! FIXME (minify-errors-in-prod): Unminified error message in production build!*/
/*! <expected-error-format>\\"bar\\"</expected-error-format>*/
var val = someBool ? //eslint-disable-next-line react-internal/prod-error-codes
new Error('foo') : someOtherBool ? new Error('bar') : //eslint-disable-next-line react-internal/prod-error-codes
new Error('baz');"
`;
exports[`error transform handles ignoring errors that are comment-excluded outside ternary expressions 1`] = `
"//eslint-disable-next-line react-internal/prod-error-codes
var val = someBool ? new Error('foo') : someOtherBool ? new Error('bar') : new Error('baz');"
`;
exports[`error transform should not touch other calls or new expressions 1`] = `
"new NotAnError();
NotAnError();"
`;
exports[`error transform should output FIXME for errors that don't have a matching error code 1`] = `
"/*! FIXME (minify-errors-in-prod): Unminified error message in production build!*/
/*! <expected-error-format>\\"This is not a real error message.\\"</expected-error-format>*/
Error('This is not a real error message.');"
`;
exports[`error transform should output FIXME for errors that don't have a matching error code, unless opted out with a comment 1`] = `
"// eslint-disable-next-line react-internal/prod-error-codes
Error('This is not a real error message.');"
`;
exports[`error transform should replace error constructors (no new) 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(16));"
`;
exports[`error transform should replace error constructors 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(16));"
`;
exports[`error transform should support error constructors with concatenated messages 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(7, foo, bar));"
`;
exports[`error transform should support interpolating arguments with concatenation 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(7, foo, bar));"
`;
exports[`error transform should support interpolating arguments with template strings 1`] = `
"import _formatProdErrorMessage from \\"shared/formatProdErrorMessage\\";
Error(_formatProdErrorMessage(7, foo, bar));"
`;