Unverified Commit baa4b9b4 authored by Ruben Bridgewater's avatar Ruben Bridgewater
Browse files

test: refactor `common.expectWarning()`

The current API is somewhat confusing at times and simpler usage is
possible. This overloads the arguments further to accept objects
with deprecation codes as property keys. It also adds documentation
for the different possible styles.

Besides that it is now going to validate for the code being present
in case of deprecations but not for other cases. The former validation
was not consistent as it only validated some cases and accepted
undefined instead of `common.noWarnCode`. This check is removed due to
the lack of consistency. `common.noWarnCode` is completely removed
due to just being sugar for `undefined`.

This also verifies that the warning order is identical to the order
in which they are triggered.

PR-URL: https://github.com/nodejs/node/pull/25251


Reviewed-By: default avatarDaniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 284b20bf
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment