/
wrongEnv.test.ts.snap
115 lines (86 loc) · 3.26 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// 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
○ skipped use navigator
● 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 navigator 1`] = `
FAIL __tests__/node.js
✕ use navigator
○ skipped use document
○ skipped use window
● use navigator
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: navigator is not defined
30 |
31 | test('use navigator', () => {
> 32 | const userAgent = navigator.userAgent;
| ^
33 |
34 | console.log(userAgent);
35 |
at Object.navigator (__tests__/node.js:32:21)
`;
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
○ skipped use navigator
● 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)
`;