Dominic Gannaway

Results 324 comments of Dominic Gannaway

Do you have JSDOM set as your Vitest env?

Svelte 5 uses microtasks for scheduling, you can force things to be sync by using `flushSync()` after mutations: ```js item.selected = true; flushSync(); ``` However, given you're not using effects,...

Yeah it likely won't make a difference. I'll take a look into this on Monday :) I'm away without my laptop this weekend

@brunnerh What if you do this without SvelteKit? i.e default `sv`?

I see an issue though: https://github.com/abdel-17/svelte-vitest-set-bug-repro/blob/main/src/demo.svelte.spec.ts This path won't work AFAIK. The `vite-plugin-svelte` module only handles `*.svelte.ts` and `*.svelte.js` files. Maybe try: https://github.com/abdel-17/svelte-vitest-set-bug-repro/blob/main/src/demo.spec.svelte.ts

None of this makes sense, unless vite is doing some module isolation logic that means that the runtime and the tests aren't connected. Like I said, I have no computer...

This is a tricky one, as `toJSON` is a standard JS function for JSON serialisation and one of the constraints of it is that it can't self reference. Ignoring Svelte,...

Rather than passing arounds store, you should be passing in the value from the store into the snippet. This is because we can't create subscriptions inside the snippet – which...

> > Rather than passing arounds store, you should be passing in the value from the store into the snippet. This is because we can't create subscriptions inside the snippet...

`fromStore` only converts the subscription into a signal, it doesn't apply deep state to them – by design.