Skip to content

Commit c9b176c

Browse files
pierrezimmermannbammdjastrzebski
authored andcommitted
refactor: move asyncWrapper to helper folder cause its not direclty tied to userevent
1 parent c3ed7d9 commit c9b176c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/user-event/utils/asyncWrapper.ts renamed to src/helpers/asyncWrapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { act } from 'react-test-renderer';
2-
import { getIsReactActEnvironment, setReactActEnvironment } from '../../act';
3-
import { flushMicroTasksLegacy } from '../../flush-micro-tasks';
4-
import { checkReactVersionAtLeast } from '../../react-versions';
2+
import { getIsReactActEnvironment, setReactActEnvironment } from '../act';
3+
import { flushMicroTasksLegacy } from '../flush-micro-tasks';
4+
import { checkReactVersionAtLeast } from '../react-versions';
55

66
export const asyncWrapper = async <T>(
77
callback: () => Promise<T>

src/user-event/setup/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TypeOptions, type } from '../type';
55
import { clear } from '../clear';
66
import { ScrollToOptions, scrollTo } from '../scroll';
77
import { wait } from '../utils';
8-
import { asyncWrapper } from '../utils/asyncWrapper';
8+
import { asyncWrapper } from '../../helpers/asyncWrapper';
99

1010
export interface UserEventSetupOptions {
1111
/**

src/waitFor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
clearTimeout,
88
jestFakeTimersAreEnabled,
99
} from './helpers/timers';
10-
import { asyncWrapper } from './user-event/utils/asyncWrapper';
10+
import { asyncWrapper } from './helpers/asyncWrapper';
1111

1212
const DEFAULT_INTERVAL = 50;
1313

0 commit comments

Comments
 (0)