diff --git a/.travis.yml b/.travis.yml index f3fa8cd..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' diff --git a/package.json b/package.json index f9c833a..da8facb 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ "p-map": "^3.0.0" }, "devDependencies": { - "ava": "^1.4.1", + "ava": "^2.2.0", "delay": "^4.1.0", - "in-range": "^1.0.0", + "in-range": "^2.0.0", "time-span": "^3.0.0", "tsd": "^0.7.1", "xo": "^0.24.0" diff --git a/readme.md b/readme.md index 0a2d45f..ba2db46 100644 --- a/readme.md +++ b/readme.md @@ -104,7 +104,7 @@ const runJob = PProgress.fn(async (name, progress) => { })(); ``` -### PProgress.all(promises, [options]) +### PProgress.all(promises, options?) Convenience method to run multiple promises and get a total progress of all of them. It counts normal promises with progress `0` when pending and progress `1` when resolved. For `PProgress` type promises, it listens to their `onProgress()` method for more fine grained progress reporting. You can mix and match normal promises and `PProgress` promises. @@ -152,7 +152,7 @@ Array of promises or promise-returning functions, similar to [p-all](https://git #### options -Type: `Object` +Type: `object` ##### concurrency @@ -171,8 +171,3 @@ When this option is set, the first argument must be an array of promise-returnin - [p-cancelable](https://github.com/sindresorhus/p-cancelable) - Create a promise that can be canceled - [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/test.js b/test.js index 2d14934..4059c74 100644 --- a/test.js +++ b/test.js @@ -143,5 +143,8 @@ test('PProgress.all() with concurrency = 1', async t => { fixture ]); - t.true(inRange(end(), 200 /* 4 delays of 50ms each */, 250 /* reasonable padding */)); + t.true(inRange(end(), { + start: 200, // 4 delays of 50ms each + end: 250 // Reasonable padding + })); });