Socket
Socket
Sign inDemoInstall

flush-promises

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

5

index.d.ts

@@ -1,1 +0,4 @@

export declare function flushPromises(): Promise<any>;
declare function flushPromises(): Promise<any>;
declare namespace flushPromises {}
export = flushPromises;

2

package.json
{
"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);
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc