summaryrefslogtreecommitdiff
path: root/node_modules/fastq/test
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
commitf06956efd2dc4bf77244a9fcce2b883a00b925af (patch)
tree0123cb73ce67f1f4b17e1d6cbabff076ee44e31b /node_modules/fastq/test
parent8d980c13970c15b6d2312b6fc4ac51698dd0d220 (diff)
updated node modules
Diffstat (limited to 'node_modules/fastq/test')
-rw-r--r--node_modules/fastq/test/example.ts2
-rw-r--r--node_modules/fastq/test/test.js16
2 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/fastq/test/example.ts b/node_modules/fastq/test/example.ts
index c454e9d0..a47d4419 100644
--- a/node_modules/fastq/test/example.ts
+++ b/node_modules/fastq/test/example.ts
@@ -32,6 +32,8 @@ queue.pause()
queue.resume()
+queue.running()
+
queue.saturated = () => undefined
queue.unshift('world', (err, result) => {
diff --git a/node_modules/fastq/test/test.js b/node_modules/fastq/test/test.js
index 1cc78a56..accbaf94 100644
--- a/node_modules/fastq/test/test.js
+++ b/node_modules/fastq/test/test.js
@@ -564,3 +564,19 @@ test('push with worker throwing error', function (t) {
t.match(err.message, /test error/, 'error message should be "test error"')
})
})
+
+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"')
+ })
+})