testing-library/svelte-testing-library

svelte5: "TypeError: act is not a function" on 4.2.2

Closed this issue · 3 comments

Hi!

Just tried out 4.2.2 with Svelte 5 and I am getting a "TypeError: act is not a function".

I believe the corresponding code is this:

import { act, cleanup } from './svelte5.js'

Because svelte5.js exports render and cleanup, not act.

Locally, I've imported act from pure.js, but I don't know if that's the intention (otherwise I would have PR'd instead of just opening a ticket).

import { act } from "./pure.js"
import { cleanup } from './svelte5.js'
mcous commented

Intention is to be able to replace @testing-library/svelte with @testing-library/svelte/svelte5. That import line is certainly incorrect

I've opened #346 to fix the issue

mcous commented

@yanick we're good to close this one out, too! I must've forgotten to add the ticket number to the commit message or something

Gotcha. And out it goes!