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
i have a few test for a few sveltekit components and vitest complain at the end about root.$set not defined.
Which is probably true as i only test components and never a whole page, whatever that is in vitest with sveltekit context...
It doesn't matter which test(s) i run, it comes after any run.
I do mock a lot of stuff in the setup, like the "$app" and "$navigation" and MSW and some env vars. (most stuff taken from davipon
Is this something to worry?
How to avoid this? Can i mock root in the setup? Should i? How?
The error:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: Cannot read properties of undefined (reading '$set')
❯ Module.applyAction node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@_sho4bexov2rcm6kasmhs4uc76i/node_modules/@sveltejs/kit/src/runtime/client/client.js:1955:8
1953| _goto(result.location, { invalidateAll: true }, 0);
1954| } else {
1955| /** @type {Record<string, any>} */
| ^
1956| root.$set({
1957| // this brings Svelte's view of the world in line with SvelteKit's
❯ fallback_callback node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]_@types+node@_sho4bexov2rcm6kasmhs4uc76i/node_modules/@sveltejs/kit/src/runtime/app/forms.js:113:26
❯ src/lib/components/SearchCustomer.svelte:2124:4
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
i have a few test for a few sveltekit components and vitest complain at the end about
root.$set
not defined.Which is probably true as i only test components and never a whole page, whatever that is in vitest with sveltekit context...
It doesn't matter which test(s) i run, it comes after any run.
I do mock a lot of stuff in the setup, like the "$app" and "$navigation" and MSW and some env vars. (most stuff taken from davipon
Is this something to worry?
How to avoid this? Can i mock root in the setup? Should i? How?
The error:
Beta Was this translation helpful? Give feedback.
All reactions