1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-06 23:56:13 +02:00

Chore: Reduce mobile note screen test flakiness (#11145)

This commit is contained in:
Henry Heino
2024-09-28 08:20:46 -07:00
committed by GitHub
parent 916b3f6f69
commit 5fceb5a3c9
3 changed files with 59 additions and 43 deletions

View File

@ -1125,7 +1125,8 @@ export const runWithFakeTimers = async (callback: ()=> Promise<void>) => {
throw new Error('Fake timers are only supported in jest.');
}
jest.useFakeTimers();
// advanceTimers: Needed by Joplin's database driver
jest.useFakeTimers({ advanceTimers: true });
// The shim.setTimeout and similar functions need to be changed to
// use fake timers.