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
assertNotDefaultExport(node,`Cannot export the result of "${method}". Remove export declaration because "${method}" doesn\'t return anything.`)
222
+
constdeclarationNode=getVariableDeclaration(node)
223
+
if(declarationNode)
224
+
assertNotNamedExport(declarationNode,`Cannot export the result of "${method}". Remove export declaration because "${method}" doesn\'t return anything.`)
Copy file name to clipboardexpand all lines: test/core/test/__snapshots__/injector-mock.test.ts.snap
+40
Original file line number
Diff line number
Diff line change
@@ -120,3 +120,43 @@ exports[`throws an error when nodes are incompatible > correctly throws an error
120
120
5|})
121
121
6| "
122
122
`;
123
+
124
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is exported as a named export 1`] =`"Cannot export the result of "vi.mock". Remove export declaration because "vi.mock" doesn't return anything."`;
125
+
126
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is exported as a named export 2`] =`
127
+
" 1| import {vi} from 'vitest'
128
+
2|
129
+
3| export const mocked = vi.mock('./mocked')
130
+
| ^
131
+
4| "
132
+
`;
133
+
134
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is exported as default export 1`] =`"Cannot export the result of "vi.mock". Remove export declaration because "vi.mock" doesn't return anything."`;
135
+
136
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.mock is exported as default export 2`] =`
137
+
" 1| import {vi} from 'vitest'
138
+
2|
139
+
3| export default vi.mock('./mocked')
140
+
| ^
141
+
4| "
142
+
`;
143
+
144
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.unmock is exported as a named export 1`] =`"Cannot export the result of "vi.unmock". Remove export declaration because "vi.unmock" doesn't return anything."`;
145
+
146
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.unmock is exported as a named export 2`] =`
147
+
" 1| import {vi} from 'vitest'
148
+
2|
149
+
3| export const mocked = vi.unmock('./mocked')
150
+
| ^
151
+
4| "
152
+
`;
153
+
154
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.unmock is exported as default export 1`] =`"Cannot export the result of "vi.unmock". Remove export declaration because "vi.unmock" doesn't return anything."`;
155
+
156
+
exports[`throws an error when nodes are incompatible > correctly throws an error if vi.unmock is exported as default export 2`] =`
0 commit comments