/
wrongEnv.test.ts.snap
89 lines (66 loc) · 2.54 KB
/
wrongEnv.test.ts.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
77
78
79
80
81
82
83
84
85
86
87
88
89
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Wrong globals for environment print useful error for document 1`] = `
"FAIL __tests__/node.js
✕ use document
○ skipped use window
● use document
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
Consider using the \\"jsdom\\" test environment.
ReferenceError: document is not defined
14 |
15 | test('use document', () => {
> 16 | const div = document.createElement('div');
| ^
17 |
18 | console.log(div);
19 |
at Object.document (__tests__/node.js:16:15)"
`;
exports[`Wrong globals for environment print useful error for unref 1`] = `
"FAIL __tests__/jsdom.js
✕ use unref
● use unref
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
Consider using the \\"node\\" test environment.
TypeError: setTimeout(...).unref is not a function
11 |
12 | test('use unref', () => {
> 13 | setTimeout(() => {}, 0).unref();
| ^
14 |
15 | expect(1).toBe(1);
16 | });
at Object.unref (__tests__/jsdom.js:13:27)"
`;
exports[`Wrong globals for environment print useful error for window 1`] = `
"FAIL __tests__/node.js
✕ use window
○ skipped use document
● use window
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
Consider using the \\"jsdom\\" test environment.
ReferenceError: window is not defined
22 |
23 | test('use window', () => {
> 24 | const location = window.location;
| ^
25 |
26 | console.log(location);
27 |
at Object.window (__tests__/node.js:24:20)"
`;
exports[`Wrong globals for environment print useful error when it explodes during evaluation 1`] = `
"FAIL __tests__/beforeTest.js
● Test suite failed to run
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
Consider using the \\"jsdom\\" test environment.
ReferenceError: document is not defined
11 | /* eslint-env browser */
12 |
> 13 | const div = document.createElement('div');
| ^
14 |
15 | console.log(div);
16 |
at Object.document (__tests__/beforeTest.js:13:13)"
`;