You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const_error=newSyntaxError(`Cannot call ${getNodeName(insideCall)} inside ${getNodeName(outsideCall)}: both methods are hoisted to the top of the file and not actually called inside each other.`)
254
+
// throw an object instead of an error so it can be serialized for RPC, TODO: improve error handling in rpc serializer
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|constvariable=vi.hoisted(() =>1)
9
+
|^
10
+
6|console.log(variable)
11
+
7|})"
12
+
`;
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."`;
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|awaitvi.hoisted(() =>1)
20
+
|^
21
+
6|})
22
+
7| "
23
+
`;
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."`;
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|constvariable=awaitvi.hoisted(() =>1)
31
+
|^
32
+
6|})
33
+
7| "
34
+
`;
35
+
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."`;
37
+
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')
42
+
|^
43
+
6|})
44
+
7| "
45
+
`;
46
+
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."`;
48
+
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')
53
+
|^
54
+
6|})
55
+
7| "
56
+
`;
57
+
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."`;
59
+
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')
64
+
|^
65
+
6|})
66
+
7| "
67
+
`;
68
+
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."`;
70
+
71
+
exports[`throws an error when nodes are incompatible > correctly throws an error 14`] =`
0 commit comments