mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-23 22:32:40 +00:00
feat: Use Vitest for testing (#25284)
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
1 parent
5d059b7bcb
commit
06f44533af
51 files changed
+2606
-4771
No files matched your search
+3
-4
@@ -1,10 +1,9 @@
|
||||
export type EventHandler = (...args: unknown[]) => unknown;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type JestMockAny = jest.Mock<any, any, any>;
|
||||
export async function flushPromises(): Promise<void> {
|
||||
const nodeTimers = await vi.importActual<typeof import('node:timers')>('node:timers');
|
||||
|
||||
export function flushPromises(): Promise<void> {
|
||||
return new Promise(jest.requireActual('node:timers').setImmediate);
|
||||
return await new Promise(nodeTimers.setImmediate);
|
||||
}
|
||||
|
||||
// https://github.com/jestjs/jest/issues/6028#issuecomment-567669082
|
||||
|
||||
Reference in new issue
Block a user