mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
test: replace assert.throws w/ common.expectsError
PR-URL: https://github.com/nodejs/node/pull/17557 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
4df7c190bf
commit
094bfaf769
19 changed files with 134 additions and 132 deletions
|
@ -3,7 +3,6 @@
|
|||
const common = require('../common');
|
||||
if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
const assert = require('assert');
|
||||
const http2 = require('http2');
|
||||
|
||||
// Check if correct errors are emitted when wrong type of data is passed
|
||||
|
@ -40,19 +39,19 @@ server.listen(0, common.mustCall(() => {
|
|||
return;
|
||||
}
|
||||
|
||||
assert.throws(
|
||||
common.expectsError(
|
||||
() => client.request({
|
||||
':method': 'CONNECT',
|
||||
':authority': `localhost:${port}`
|
||||
}, {
|
||||
[option]: types[type]
|
||||
}),
|
||||
common.expectsError({
|
||||
{
|
||||
type: TypeError,
|
||||
code: 'ERR_INVALID_OPT_VALUE',
|
||||
message: `The value "${String(types[type])}" is invalid ` +
|
||||
`for option "${option}"`
|
||||
})
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue