mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
15 lines
354 B
TypeScript
15 lines
354 B
TypeScript
import { assert, use } from 'chai'
|
|
import chaiSubset from 'chai-subset'
|
|
use(chaiSubset)
|
|
|
|
export const shouldReject = async (promise: Promise<unknown>, errType = Error, message = 'Should have rejected') => {
|
|
try {
|
|
await promise
|
|
} catch (err) {
|
|
assert.instanceOf(err, errType)
|
|
return err
|
|
}
|
|
throw new Error(message)
|
|
}
|
|
|
|
export { assert }
|