Comparing version 1.15.0 to 1.16.0
@@ -15,2 +15,3 @@ declare function fastq<C, T = any, R = any>(context: C, worker: fastq.worker<C, T, R>, concurrency: number): fastq.queue<T, R> | ||
resume(): any | ||
running(): number | ||
idle(): boolean | ||
@@ -17,0 +18,0 @@ length(): number |
{ | ||
"name": "fastq", | ||
"version": "1.15.0", | ||
"version": "1.16.0", | ||
"description": "Fast, in memory work queue", | ||
@@ -11,3 +11,3 @@ "main": "queue.js", | ||
"test:report": "npm run lint && npm run unit:report", | ||
"test": "npm run lint && npm run unit && npm run typescript", | ||
"test": "npm run lint && npm run unit", | ||
"typescript": "tsc --project ./test/tsconfig.json", | ||
@@ -17,3 +17,4 @@ "legacy": "tape test/test.js" | ||
"pre-commit": [ | ||
"test" | ||
"test", | ||
"typescript" | ||
], | ||
@@ -44,3 +45,3 @@ "repository": { | ||
"tape": "^5.0.0", | ||
"typescript": "^4.0.2" | ||
"typescript": "^5.0.4" | ||
}, | ||
@@ -47,0 +48,0 @@ "dependencies": { |
@@ -121,2 +121,3 @@ 'use strict' | ||
current.callback = done || noop | ||
current.errorHandler = errorHandler | ||
@@ -123,0 +124,0 @@ if (_running === self.concurrency || self.paused) { |
@@ -35,2 +35,4 @@ import * as fastq from '../' | ||
queue.running() | ||
queue.saturated = () => undefined | ||
@@ -37,0 +39,0 @@ |
@@ -567,1 +567,17 @@ 'use strict' | ||
}) | ||
test('unshift with worker throwing error', function (t) { | ||
t.plan(5) | ||
var q = buildQueue(function (task, cb) { | ||
cb(new Error('test error'), null) | ||
}, 1) | ||
q.error(function (err, task) { | ||
t.ok(err instanceof Error, 'global error handler should catch the error') | ||
t.match(err.message, /test error/, 'error message should be "test error"') | ||
t.equal(task, 42, 'The task executed should be passed') | ||
}) | ||
q.unshift(42, function (err) { | ||
t.ok(err instanceof Error, 'unshift callback should catch the error') | ||
t.match(err.message, /test error/, 'error message should be "test error"') | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
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
40056
1050