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
import { render, screen } from '@testing-library/preact';
What you did:
Tried to import from @testing-library/preact'
What happened:
SyntaxError: The requested module '@testing-library/preact' does not provide an export named 'render'
at jasmine2 (node_modules/jest-jasmine2/build/index.js:228:5)
Problem description:
Currently @testing-library/preact does not offer ESM output, which makes it unsuitable for testing in a native ESM environment. This will begin to be a problem especially now that Node 10 is EOL ("type": "module" was first valid in v12.0.0, the now oldest support version of Node).
preact-testing-library
version:2.0.1
preact
version:10.5.13
node
version:14.16.0
npm
(oryarn
) version: yarn1.22.10
Relevant code or config
import { render, screen } from '@testing-library/preact';
What you did:
Tried to import from
@testing-library/preact'
What happened:
Problem description:
Currently
@testing-library/preact
does not offer ESM output, which makes it unsuitable for testing in a native ESM environment. This will begin to be a problem especially now that Node 10 is EOL ("type": "module"
was first valid in v12.0.0, the now oldest support version of Node).Edit: Apparently not. Apparently Jest doesn't even follow the widely used practice of the@testing-library/react
does however support ESM, sopreact
here is behind.module
key: jestjs/jest#2702 (comment)Suggested solution:
Offer ESM output. Will just take an alteration of the build script.
The text was updated successfully, but these errors were encountered: