Skip to content

Commit 8bfb697

Browse files
committed
Lint
1 parent 0ad9191 commit 8bfb697

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import * as util from "util";
44
// Grab the setTimeout from global before jest overwrites it with useFakeTimers
55
const setTimeoutBypassingFakes = global.setTimeout;
66

7+
type Timeout = ReturnType<typeof setTimeout>;
8+
79
/**
810
* Wait a number of milliseconds of _real time_ (not mocked time); useful for
911
* allowing the runloop or external systems to advance.
@@ -13,8 +15,8 @@ const setTimeoutBypassingFakes = global.setTimeout;
1315
export const sleep = (
1416
ms: number,
1517
unref = false,
16-
): Promise<void> & { timeout: NodeJS.Timeout } => {
17-
let timeout!: NodeJS.Timeout;
18+
): Promise<void> & { timeout: Timeout } => {
19+
let timeout!: Timeout;
1820
const promise = new Promise<void>((resolve) => {
1921
timeout = setTimeoutBypassingFakes(resolve, ms);
2022
});

0 commit comments

Comments
 (0)