0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/test/internet
Ruben Bridgewater e038d6a1cd
test: refactor common.expectsError
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.

The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.

This has the side effect that `common` is used significantly less
frequent.

PR-URL: https://github.com/nodejs/node/pull/31092
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-12-31 15:54:20 +01:00
..
test-dgram-broadcast-multi-process.js test: refactor test-dgram-broadcast-multi-process 2019-03-23 19:58:04 -07:00
test-dgram-connect.js test: use common.PORT instead of an extraneous variable 2019-05-13 14:26:40 -07:00
test-dgram-membership.js
test-dgram-multicast-multi-process.js test: remove unused catch bindings 2018-11-06 10:59:18 -05:00
test-dgram-multicast-set-interface-lo.js test: refactor test-dgram-multicast-set-interface-lo.js 2019-11-21 21:52:56 -08:00
test-dgram-multicast-ssm-multi-process.js dgram: add source-specific multicast support 2019-10-17 03:12:53 +02:00
test-dgram-multicast-ssmv6-multi-process.js dgram: add source-specific multicast support 2019-10-17 03:12:53 +02:00
test-dns-any.js
test-dns-cares-domains.js
test-dns-idna2008.js test: fix test-dns-idna2008.js 2019-04-14 22:40:06 -07:00
test-dns-ipv4.js
test-dns-ipv6.js
test-dns-lookup.js test: add dns.onlookupall() to increase coverage 2018-09-27 05:40:12 +02:00
test-dns-promises-resolve.js test: refactor common.expectsError 2019-12-31 15:54:20 +01:00
test-dns-regress-6244.js
test-dns-setserver-in-callback-of-resolve4.js
test-dns-txt-sigsegv.js
test-dns.js lib: correct error.errno to always be numeric 2019-06-17 10:18:09 +08:00
test-http-dns-fail.js
test-http-https-default-ports.js
test-inspector-help-page.js
test-net-connect-timeout.js
test-net-connect-unref.js test: remove setTimeout in test-net-connect-unref 2018-07-26 16:43:21 -07:00
test-tls-add-ca-cert.js
test-tls-connnect-melissadata.js
test-tls-reuse-host-from-socket.js
test-trace-events-dns.js test: don't inspect values if not necessary 2018-09-18 13:12:34 +02:00
test-uv-threadpool-schedule.js test: tune test-uv-threadpool-schedule 2019-01-07 19:08:05 -08:00
testcfg.py