Skip to content

Commit 2ba1987

Browse files
author
pierrezimmermann
committed
feat: update warning when using userEvent with real timers
1 parent 9f6cb60 commit 2ba1987

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/user-event/press/utils/warnAboutRealTimers.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ test('logs a warning about usign real timers with user event', () => {
66
warnAboutRealTimers();
77

88
expect(mockConsoleWarn.mock.calls[0][0]).toMatchInlineSnapshot(`
9-
"It is not recommended to use userEvent without using fake timers
9+
"It is recommended to use userEvent with fake timers
1010
Some events involve duration so your tests may take a long time to run.
11-
For instance calling userEvent.longPress with real timers will take 500 ms"
11+
For instance calling userEvent.longPress with real timers will take 500 ms."
1212
`);
1313
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const warnAboutRealTimers = () => {
22
// eslint-disable-next-line no-console
3-
console.warn(`It is not recommended to use userEvent without using fake timers
3+
console.warn(`It is recommended to use userEvent with fake timers
44
Some events involve duration so your tests may take a long time to run.
5-
For instance calling userEvent.longPress with real timers will take 500 ms`);
5+
For instance calling userEvent.longPress with real timers will take 500 ms.`);
66
};

0 commit comments

Comments
 (0)