Closed mcous closed 3 months ago
@yanick did you see this one? Relatively bad regression on the next
tag
yup. was waiting for the other branch to be merged.
:tada: This PR is included in version 4.2.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Overview
328 moved exports from
pure.js
toindex.js
and switched everything to wildcard exports:https://github.com/testing-library/svelte-testing-library/blob/0593819ca0e083eadf536d20d9d61944d594fb91/src/index.js#L15-L16
If two wildcard exports emit the same export, neither will be included.
This means the current release on
next
is not exportingfireEvent
. This PR moves the STL exports back to named exports to resolve the bugObserving the bug
Why didn't tests catch this?
Vite/Vitest appears to resolve exports differently from local files compared to
node_modules
. Since the test suite imports directly fromsrc/index.js
, the behavior is slightly different:fireEvent
is availableIn our case, since
export * from '@testing-library/dom'
is listed second, that means the tests are running with the vanillafireEvent
, and coincidentally passing because a no-opawait
in the test was enough of a wait for Svelte to flush pending changes.Without a more sophisticated test suite that packs and installs the library into example projects (which is a good long term idea!) this particular problem is hard to guard against with unit tests.
Change log
fireEvent
is returning a Promise