Open
Description
Reproduction example
Note: unable to provide a codesandbox link due to the inability to control the version of TypeScript used by the IDE
Prerequisites
[email protected]
@testing-library/[email protected]
- package.json
type: module
- tsconfig
moduleResolution
set toNode16
// tsconfig
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node16"
}
}
Expected behavior
userEvent
should be the default export of the module
import userEvent from "@testing-library/user-event";
userEvent.click(...);
Actual behavior
userEvent
is exported as a named export called default
import userEvent from "@testing-library/user-event";
userEvent.default.click(...);
User-event version
14.4.3
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
This may be invalid for Node 16's ESM spec.
I suspect changing it to the following will resolve the issue:
import {userEvent} from './setup';
export default userEvent;