|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`Wrong globals for environment print useful error for document 1`] = ` |
| 4 | +FAIL __tests__/node.js |
| 5 | + ✕ use document |
| 6 | + ○ skipped use window |
| 7 | + ○ skipped use navigator |
| 8 | +
|
| 9 | + ● use document |
| 10 | +
|
| 11 | + The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string. |
| 12 | + Consider using the "jsdom" test environment. |
| 13 | +
|
| 14 | + ReferenceError: document is not defined |
| 15 | +
|
| 16 | + 14 | |
| 17 | + 15 | test('use document', () => { |
| 18 | + > 16 | const div = document.createElement('div'); |
| 19 | + | ^ |
| 20 | + 17 | |
| 21 | + 18 | console.log(div); |
| 22 | + 19 | |
| 23 | +
|
| 24 | + at Object.document (__tests__/node.js:16:15) |
| 25 | +`; |
| 26 | +
|
| 27 | +exports[`Wrong globals for environment print useful error for navigator 1`] = ` |
| 28 | +FAIL __tests__/node.js |
| 29 | + ✕ use navigator |
| 30 | + ○ skipped use document |
| 31 | + ○ skipped use window |
| 32 | +
|
| 33 | + ● use navigator |
| 34 | +
|
| 35 | + The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string. |
| 36 | + Consider using the "jsdom" test environment. |
| 37 | +
|
| 38 | + ReferenceError: navigator is not defined |
| 39 | +
|
| 40 | + 30 | |
| 41 | + 31 | test('use navigator', () => { |
| 42 | + > 32 | const userAgent = navigator.userAgent; |
| 43 | + | ^ |
| 44 | + 33 | |
| 45 | + 34 | console.log(userAgent); |
| 46 | + 35 | |
| 47 | +
|
| 48 | + at Object.navigator (__tests__/node.js:32:21) |
| 49 | +`; |
| 50 | +
|
| 51 | +exports[`Wrong globals for environment print useful error for unref 1`] = ` |
| 52 | +FAIL __tests__/jsdom.js |
| 53 | + ✕ use unref |
| 54 | +
|
| 55 | + ● use unref |
| 56 | +
|
| 57 | + The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string. |
| 58 | + Consider using the "node" test environment. |
| 59 | +
|
| 60 | + TypeError: setTimeout(...).unref is not a function |
| 61 | +
|
| 62 | + 11 | |
| 63 | + 12 | test('use unref', () => { |
| 64 | + > 13 | setTimeout(() => {}, 0).unref(); |
| 65 | + | ^ |
| 66 | + 14 | |
| 67 | + 15 | expect(1).toBe(1); |
| 68 | + 16 | }); |
| 69 | +
|
| 70 | + at Object.unref (__tests__/jsdom.js:13:27) |
| 71 | +`; |
| 72 | +
|
| 73 | +exports[`Wrong globals for environment print useful error for window 1`] = ` |
| 74 | +FAIL __tests__/node.js |
| 75 | + ✕ use window |
| 76 | + ○ skipped use document |
| 77 | + ○ skipped use navigator |
| 78 | +
|
| 79 | + ● use window |
| 80 | +
|
| 81 | + The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string. |
| 82 | + Consider using the "jsdom" test environment. |
| 83 | +
|
| 84 | + ReferenceError: window is not defined |
| 85 | +
|
| 86 | + 22 | |
| 87 | + 23 | test('use window', () => { |
| 88 | + > 24 | const location = window.location; |
| 89 | + | ^ |
| 90 | + 25 | |
| 91 | + 26 | console.log(location); |
| 92 | + 27 | |
| 93 | +
|
| 94 | + at Object.window (__tests__/node.js:24:20) |
| 95 | +`; |
| 96 | +
|
| 97 | +exports[`Wrong globals for environment print useful error when it explodes during evaluation 1`] = ` |
| 98 | +FAIL __tests__/beforeTest.js |
| 99 | + ● Test suite failed to run |
| 100 | +
|
| 101 | + The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string. |
| 102 | + Consider using the "jsdom" test environment. |
| 103 | +
|
| 104 | + ReferenceError: document is not defined |
| 105 | +
|
| 106 | + 11 | /* eslint-env browser */ |
| 107 | + 12 | |
| 108 | + > 13 | const div = document.createElement('div'); |
| 109 | + | ^ |
| 110 | + 14 | |
| 111 | + 15 | console.log(div); |
| 112 | + 16 | |
| 113 | +
|
| 114 | + at Object.document (__tests__/beforeTest.js:13:13) |
| 115 | +`; |
0 commit comments