Closed
Description
preact-testing-library
version: 1.0.2preact
version: 10.4.4node
version: 12.16.3npm
(oryarn
) version: yarn 1.22.4
Relevant code or config
// jest.config.js
moduleNameMapper: {
'^react$': 'preact/compat',
'^react-dom/test-utils$': 'preact/test-utils',
'^react-dom$': 'preact/compat',
'^@testing-library/react$': '@testing-library/preact',
What you did:
Tried to alias @testing-library/react
to @testing-library/preact
because we're aliasing react
and react-dom
to preact/compat
.
What happened:
Fails with an error that it cannot find waitFor, but I also suspect there may be other differences in the api's of both the libraries.
Reproduction repository:
Problem description:
We'd like our jest tests to run against preact and not react as long as we are using the preact/compat
alias so that we know our tests(and hence implementations) work in preact.
Suggested solution:
Firstly, update the @testing-library/dom
package to the latest version, and secondly, match any other mismatches in the library apis.