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
Description
When testing a form which uses formsnap & superforms the test fails with an error as soon as I try to submit the form (in browser everything works fine). Tried with both SPA: true mode and without it.
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/@sveltejs/kit/src/runtime/client/client.js:1990:8
1988| _goto(result.location, { invalidateAll: true }, 0);
1989| } else {
1990| /** @type {Record<string, any>} */
| ^
1991| root.$set({
1992| // this brings Svelte's view of the world in line with SvelteKit's
❯ validationResponse node_modules/sveltekit-superforms/dist/client/superForm.js:1396:62
❯ Timeout._onTimeout node_modules/sveltekit-superforms/dist/client/superForm.js:1125:34
❯ listOnTimeout node:internal/timers:569:17
❯ processTimers node:internal/timers:512:7
@ciscoheat yes I checked that issue and copy pasted mocking from your test but unfortunately still I get the same error and I am not sure how to mock / resolve it 🫤 The only "workaround" is to pass applyAction: false to superForm() options but that's not optimal for obvious reasons.
Description
When testing a form which uses formsnap & superforms the test fails with an error as soon as I try to submit the form (in browser everything works fine). Tried with both
SPA: true
mode and without it.Relevant dependencies:
Tested form:
Error:
MRE
All the code with test itself is available here:
https://github.com/peterbabinec/svelte-form/blob/main/src/routes/settings/page.test.ts
Just clone it, install and run the test.
The text was updated successfully, but these errors were encountered: