if (fn instanceof Promise) {
try {
await fn
- throw new Error(msg ?? 'expected async function to reject')
} catch (err) {
return true
}
+ throw new Error(msg ?? 'expected async function to reject')
} else {
throw new Error(msg ?? 'expected async function')
}
}
try {
fn()
- throw new Error(msg ?? `expected function to throw an exception`)
} catch (err) {
return true
}
+ throw new Error(msg ?? `expected function to throw an exception`)
}
}