Skip to content

Commit

Permalink
feat(testing): warn about incorrect createSpy
Browse files Browse the repository at this point in the history
See #2896
  • Loading branch information
posva committed Jan 25, 2025
1 parent 58a2302 commit 394f655
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/testing/src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ export function createTestingPinia({
/* istanbul ignore if */
if (!createSpy) {
throw new Error(
'[@pinia/testing]: You must configure the `createSpy` option.'
'[@pinia/testing]: You must configure the `createSpy` option. See https://pinia.vuejs.org/cookbook/testing.html#Specifying-the-createSpy-function'
)
} else if (
typeof createSpy !== 'function' ||
'mockReturnValue' in createSpy
) {
throw new Error(
'[@pinia/testing]: Invalid `createSpy` option. See https://pinia.vuejs.org/cookbook/testing.html#Specifying-the-createSpy-function'
)
}

Expand Down

0 comments on commit 394f655

Please sign in to comment.