Closed
Description
@testing-library/jest-dom
version: 6.1.0node
version: 18npm
(oryarn
) version: yarn 3.6.0
Relevant code or config:
n/a
What you did:
Ran basic React tests, working fine with jest-dom@5, after updating to jest-dom@6 (this is important - NOT a clear install).
What happened:
SyntaxError: Named export 'parse' not found. The requested module '@adobe/css-tools' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@adobe/css-tools';
const { parse } = pkg;
Problem description:
The required version of @adobe/css-tools jest-dom declares, ^4.0.1, is NOT correct. In my lockfile, it has already been resolved to 4.2.0. This hasn't changed with jest-dom@6 update, because ^4.0.1 is still the desired version range. This produced the error above.
After investigation, it turned out @adobe/css-tools 4.3.0 is the first release with ESM support.
Suggested solution:
Bump minimum @adobe/css-tools dependency to ^4.3.0.