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

Commit

Permalink
fix user event export type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jun 19, 2023
1 parent d48cb26 commit 6cfe2cc
Showing 1 changed file with 7 additions and 2 deletions.
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 };

0 comments on commit 6cfe2cc

Please sign in to comment.