mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
`stream` seems unaffected by this but other future interfaces may not be so forgiving. - removed the unused disconnect handler that we passed to bindings in tests. - moved shouldReject to a test global - unit tested unixRead
9 lines
222 B
JavaScript
9 lines
222 B
JavaScript
global.shouldReject = async (promise, errType = Error, message = 'Should have rejected') => {
|
|
try {
|
|
await promise
|
|
} catch (err) {
|
|
assert.instanceOf(err, errType)
|
|
return err
|
|
}
|
|
throw new Error(message)
|
|
}
|