flush-promises
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,1 +0,4 @@ | ||
export declare function flushPromises(): Promise<any>; | ||
declare function flushPromises(): Promise<any>; | ||
declare namespace flushPromises {} | ||
export = flushPromises; |
{ | ||
"name": "flush-promises", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Flush promises in tests", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,1 +28,23 @@ # flush-promises | ||
``` | ||
## TypeScript | ||
```ts | ||
import * as flushPromises from "flush-promises"; | ||
test("flushPromises", async () => { | ||
let a; | ||
let b; | ||
Promise.resolve().then(() => { | ||
a = 1; | ||
}).then(() => { | ||
b = 2; | ||
}); | ||
await flushPromises(); | ||
expect(a).toBe(1); | ||
expect(b).toBe(2); | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3329
29
50