Skip to content

Commit f30b73c

Browse files
committed
Fix tests
1 parent 5156527 commit f30b73c

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/lib/D4C.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ test('Instance usage: test concurrency', async (t) => {
104104
t.is(test.str, '210.50.20.05');
105105

106106
let error = null
107+
try {
108+
d4c.setQueue(undefined as any)
109+
} catch (err) {
110+
error = err;
111+
}
112+
t.is(error.message, ErrMsg.InvalidQueueConcurrency);
113+
114+
115+
error = null
107116
try {
108117
d4c.setQueue({ limit: -100 })
109118
} catch (err) {

src/lib/D4C.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export class D4C {
304304
tag?: string | symbol;
305305
limit?: number,
306306
}) {
307-
if (concurrency?.limit === undefined || typeof (concurrency?.limit) !== "number") {
307+
if (concurrency?.limit === undefined || typeof (concurrency.limit) !== "number") {
308308
throw new Error(ErrMsg.InvalidQueueConcurrency)
309309
}
310310

0 commit comments

Comments
 (0)