-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Labels
Description
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:
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).
Edit: Apparently not. Apparently Jest doesn't even follow the widely used practice of the @testing-library/react
does however support ESM, so preact
here is behind.module
key: jestjs/jest#2702 (comment)
Suggested solution:
Offer ESM output. Will just take an alteration of the build script.
Mehdi-Hp, m00k, myobie, robak86 and connorjclark