Skip to content

Commit 01b7cea

Browse files
committed
Fix test coverage
1 parent bdbb6df commit 01b7cea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/D4C.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const timeout = (seconds: number, target?: { str: string }) => {
3333
)
3434
}
3535

36-
const timeoutError = (seconds: number, result: string) => {
36+
const timeoutError = (seconds: number, result: string | Error) => {
3737
return new Promise((_, reject) =>
3838
setTimeout(() => {
3939
reject(result)
@@ -828,7 +828,7 @@ test("Instance usage: option inheritPreErr enable: task2 inherit task1's error i
828828

829829
const fun1ErrorProducer = async () => {
830830
try {
831-
await d4c.wrap(timeoutError)(1, 'some_error')
831+
await d4c.wrap(timeoutError)(1, new Error('some_error'))
832832
} catch (_) {
833833
// console.log(" err by purpose")
834834
}

0 commit comments

Comments
 (0)