-
Notifications
You must be signed in to change notification settings - Fork 45.6k
/
transform-error-messages.js.snap
76 lines (64 loc) · 2.25 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
73
74
75
76
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`error transform should correctly transform invariants that are not in the error codes map 1`] = `
"import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
/*FIXME (minify-errors-in-prod): Unminified error message in production build!*/
(function () {
if (!condition) {
throw _ReactError(Error(\\"This is not a real error message.\\"));
}
})();"
`;
exports[`error transform should handle escaped characters 1`] = `
"import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
/*FIXME (minify-errors-in-prod): Unminified error message in production build!*/
(function () {
if (!condition) {
throw _ReactError(Error(\\"What's up?\\"));
}
})();"
`;
exports[`error transform should replace simple invariant calls 1`] = `
"import _ReactErrorProd from \\"shared/ReactErrorProd\\";
import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
if (!condition) {
if (__DEV__) {
throw _ReactError(Error(\\"Do not override existing functions.\\"));
} else {
throw _ReactErrorProd(Error(16));
}
}"
`;
exports[`error transform should support invariant calls with a concatenated template string and args 1`] = `
"import _ReactErrorProd from \\"shared/ReactErrorProd\\";
import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
if (!condition) {
if (__DEV__) {
throw _ReactError(Error(\\"Expected a component class, got \\" + Foo + \\".\\" + Bar));
} else {
throw _ReactErrorProd(Error(18), Foo, Bar);
}
}"
`;
exports[`error transform should support invariant calls with args 1`] = `
"import _ReactErrorProd from \\"shared/ReactErrorProd\\";
import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
if (!condition) {
if (__DEV__) {
throw _ReactError(Error(\\"Expected \\" + foo + \\" target to be an array; got \\" + bar));
} else {
throw _ReactErrorProd(Error(7), foo, bar);
}
}"
`;
exports[`error transform should support noMinify option 1`] = `
"import _ReactError from \\"shared/ReactError\\";
import invariant from 'shared/invariant';
if (!condition) {
throw _ReactError(Error(\\"Do not override existing functions.\\"));
}"
`;