|
1 | 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
2 | 2 |
|
3 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 1`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
4 |
| - |
5 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 2`] = ` |
6 |
| -" 3| |
7 |
| - 4| vi.mock('./mocked', () => { |
8 |
| - 5| const variable = vi.hoisted(() => 1) |
9 |
| - | ^ |
10 |
| - 6| console.log(variable) |
11 |
| - 7| })" |
| 3 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited assigned vi.hoisted is called inside vi.mock 1`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 4 | + |
| 5 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited assigned vi.hoisted is called inside vi.mock 2`] = ` |
| 6 | +" 2| |
| 7 | + 3| vi.mock('./mocked', async () => { |
| 8 | + 4| const variable = await vi.hoisted(() => 1) |
| 9 | + | ^ |
| 10 | + 5| }) |
| 11 | + 6| " |
12 | 12 | `;
|
13 | 13 |
|
14 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 3`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 14 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is called inside vi.mock 1`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
15 | 15 |
|
16 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 4`] = ` |
17 |
| -" 3| |
18 |
| - 4| vi.mock('./mocked', async () => { |
19 |
| - 5| await vi.hoisted(() => 1) |
| 16 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is called inside vi.mock 2`] = ` |
| 17 | +" 2| |
| 18 | + 3| vi.mock('./mocked', async () => { |
| 19 | + 4| await vi.hoisted(() => 1) |
20 | 20 | | ^
|
21 |
| - 6| }) |
22 |
| - 7| " |
| 21 | + 5| }) |
| 22 | + 6| " |
23 | 23 | `;
|
24 | 24 |
|
25 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 5`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 25 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is exported as default export 1`] = `"Cannot export hoisted variable. You can control hoisting behavior by placing the import from this file first."`; |
26 | 26 |
|
27 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 6`] = ` |
28 |
| -" 3| |
29 |
| - 4| vi.mock('./mocked', async () => { |
30 |
| - 5| const variable = await vi.hoisted(() => 1) |
31 |
| - | ^ |
32 |
| - 6| }) |
33 |
| - 7| " |
| 27 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is exported as default export 2`] = ` |
| 28 | +" 1| import { vi } from 'vitest' |
| 29 | + 2| |
| 30 | + 3| export default await vi.hoisted(async () => { |
| 31 | + | ^ |
| 32 | + 4| return {} |
| 33 | + 5| })" |
| 34 | +`; |
| 35 | + |
| 36 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is exported as named export 1`] = `"Cannot export hoisted variable. You can control hoisting behavior by placing the import from this file first."`; |
| 37 | + |
| 38 | +exports[`throws an error when nodes are incompatible > correctly throws an error if awaited vi.hoisted is exported as named export 2`] = ` |
| 39 | +" 1| import { vi } from 'vitest' |
| 40 | + 2| |
| 41 | + 3| export const values = await vi.hoisted(async () => { |
| 42 | + | ^ |
| 43 | + 4| return {} |
| 44 | + 5| })" |
| 45 | +`; |
| 46 | + |
| 47 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is called inside vi.mock 1`] = `"Cannot call vi.hoisted() inside vi.mock(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 48 | + |
| 49 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is called inside vi.mock 2`] = ` |
| 50 | +" 2| |
| 51 | + 3| vi.mock('./mocked', () => { |
| 52 | + 4| const variable = vi.hoisted(() => 1) |
| 53 | + | ^ |
| 54 | + 5| console.log(variable) |
| 55 | + 6| })" |
| 56 | +`; |
| 57 | + |
| 58 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is exported as a named export 1`] = `"Cannot export hoisted variable. You can control hoisting behavior by placing the import from this file first."`; |
| 59 | + |
| 60 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is exported as a named export 2`] = ` |
| 61 | +" 1| import { vi } from 'vitest' |
| 62 | + 2| |
| 63 | + 3| export const values = vi.hoisted(async () => { |
| 64 | + | ^ |
| 65 | + 4| return {} |
| 66 | + 5| })" |
| 67 | +`; |
| 68 | + |
| 69 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is exported as default 1`] = `"Cannot export hoisted variable. You can control hoisting behavior by placing the import from this file first."`; |
| 70 | + |
| 71 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.hoisted is exported as default 2`] = ` |
| 72 | +" 1| import { vi } from 'vitest' |
| 73 | + 2| |
| 74 | + 3| export default vi.hoisted(() => { |
| 75 | + | ^ |
| 76 | + 4| return {} |
| 77 | + 5| })" |
34 | 78 | `;
|
35 | 79 |
|
36 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 7`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 80 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock inside vi.hoisted 1`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
37 | 81 |
|
38 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 8`] = ` |
39 |
| -" 3| |
40 |
| - 4| vi.hoisted(() => { |
41 |
| - 5| vi.mock('./mocked') |
| 82 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock inside vi.hoisted 2`] = ` |
| 83 | +" 2| |
| 84 | + 3| vi.hoisted(() => { |
| 85 | + 4| vi.mock('./mocked') |
42 | 86 | | ^
|
43 |
| - 6| }) |
44 |
| - 7| " |
| 87 | + 5| }) |
| 88 | + 6| " |
45 | 89 | `;
|
46 | 90 |
|
47 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 9`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 91 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside assigned awaited vi.hoisted 1`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
48 | 92 |
|
49 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 10`] = ` |
50 |
| -" 3| |
51 |
| - 4| const values = vi.hoisted(() => { |
52 |
| - 5| vi.mock('./mocked') |
| 93 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside assigned awaited vi.hoisted 2`] = ` |
| 94 | +" 2| |
| 95 | + 3| const values = await vi.hoisted(async () => { |
| 96 | + 4| vi.mock('./mocked') |
53 | 97 | | ^
|
54 |
| - 6| }) |
55 |
| - 7| " |
| 98 | + 5| }) |
| 99 | + 6| " |
56 | 100 | `;
|
57 | 101 |
|
58 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 11`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 102 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside assigned vi.hoisted 1`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
59 | 103 |
|
60 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 12`] = ` |
61 |
| -" 3| |
62 |
| - 4| await vi.hoisted(async () => { |
63 |
| - 5| vi.mock('./mocked') |
| 104 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside assigned vi.hoisted 2`] = ` |
| 105 | +" 2| |
| 106 | + 3| const values = vi.hoisted(() => { |
| 107 | + 4| vi.mock('./mocked') |
64 | 108 | | ^
|
65 |
| - 6| }) |
66 |
| - 7| " |
| 109 | + 5| }) |
| 110 | + 6| " |
67 | 111 | `;
|
68 | 112 |
|
69 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 13`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
| 113 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside awaited vi.hoisted 1`] = `"Cannot call vi.mock() inside vi.hoisted(): both methods are hoisted to the top of the file and not actually called inside each other."`; |
70 | 114 |
|
71 |
| -exports[`throws an error when nodes are incompatible > correctly throws an error 14`] = ` |
72 |
| -" 3| |
73 |
| - 4| const values = await vi.hoisted(async () => { |
74 |
| - 5| vi.mock('./mocked') |
| 115 | +exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is called inside awaited vi.hoisted 2`] = ` |
| 116 | +" 2| |
| 117 | + 3| await vi.hoisted(async () => { |
| 118 | + 4| vi.mock('./mocked') |
75 | 119 | | ^
|
76 |
| - 6| }) |
77 |
| - 7| " |
| 120 | + 5| }) |
| 121 | + 6| " |
78 | 122 | `;
|
0 commit comments