Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Upgrade user-event to v14 and testing-library to v9 #43

Merged
merged 3 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"access": "public"
},
"dependencies": {
"@testing-library/dom": "^8.3.0",
"@testing-library/user-event": "^13.2.1",
"@testing-library/dom": "^9.3.1",
"@testing-library/user-event": "^14.4.3",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _userEventObj from '@testing-library/user-event';
import dedent from 'ts-dedent';

// @ts-ignore (this is to ensure ESM compatibility)
const _userEvent: typeof _userEventObj = (_userEventObj.default || _userEventObj);
const _userEvent: typeof _userEventObj = _userEventObj.default || _userEventObj;

const testingLibrary = instrument(
{ ...domTestingLibrary },
Expand Down Expand Up @@ -104,4 +104,9 @@ export const {
prettyFormat,
} = testingLibrary;

export const { userEvent } = instrument({ userEvent: _userEvent }, { intercept: true });
const userEvent: typeof _userEventObj = instrument(
{ userEvent: _userEvent },
{ intercept: true }
).userEvent;

export { userEvent };