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

Commit

Permalink
Merge pull request #43 from storybookjs/feat/upgrade-libraries
Browse files Browse the repository at this point in the history
Upgrade user-event to v14 and testing-library to v9
  • Loading branch information
yannbf committed Jun 19, 2023
2 parents 0cfd0d7 + 6cfe2cc commit 56bf6ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
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
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 };

0 comments on commit 56bf6ad

Please sign in to comment.