mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
assert: resolve TODO and rename function
Some checks failed
Coverage Windows / coverage-windows (push) Waiting to run
Linters / lint-addon-docs (push) Failing after 1m12s
Coverage Linux / coverage-linux (push) Failing after 1m10s
Coverage Linux (without intl) / coverage-linux-without-intl (push) Failing after 1m15s
Test and upload documentation to artifacts / build-docs (push) Failing after 5m7s
Linters / lint-yaml (push) Successful in 2m43s
Linters / lint-cpp (push) Successful in 3m44s
Linters / format-cpp (push) Has been skipped
Linters / lint-py (push) Successful in 2m41s
Linters / lint-sh (push) Failing after 1m26s
Linters / lint-codeowners (push) Failing after 1m3s
Linters / lint-pr-url (push) Has been skipped
Linters / lint-readme (push) Successful in 1m27s
Notify on Push / Notify on Force Push on `main` (push) Has been skipped
Notify on Push / Notify on Push on `main` that lacks metadata (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 52s
Linters / lint-js-and-md (push) Successful in 12m44s
Some checks failed
Coverage Windows / coverage-windows (push) Waiting to run
Linters / lint-addon-docs (push) Failing after 1m12s
Coverage Linux / coverage-linux (push) Failing after 1m10s
Coverage Linux (without intl) / coverage-linux-without-intl (push) Failing after 1m15s
Test and upload documentation to artifacts / build-docs (push) Failing after 5m7s
Linters / lint-yaml (push) Successful in 2m43s
Linters / lint-cpp (push) Successful in 3m44s
Linters / format-cpp (push) Has been skipped
Linters / lint-py (push) Successful in 2m41s
Linters / lint-sh (push) Failing after 1m26s
Linters / lint-codeowners (push) Failing after 1m3s
Linters / lint-pr-url (push) Has been skipped
Linters / lint-readme (push) Successful in 1m27s
Notify on Push / Notify on Force Push on `main` (push) Has been skipped
Notify on Push / Notify on Push on `main` that lacks metadata (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 52s
Linters / lint-js-and-md (push) Successful in 12m44s
PR-URL: https://github.com/nodejs/node/pull/59451 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
6626b16dd8
commit
91f035e597
2 changed files with 5 additions and 7 deletions
|
@ -83,7 +83,7 @@ function lazyLoadComparison() {
|
||||||
// AssertionError's when particular conditions are not met. The
|
// AssertionError's when particular conditions are not met. The
|
||||||
// assert module must conform to the following interface.
|
// assert module must conform to the following interface.
|
||||||
|
|
||||||
const assert = module.exports = ok;
|
module.exports = assert;
|
||||||
|
|
||||||
const NO_EXCEPTION_SENTINEL = {};
|
const NO_EXCEPTION_SENTINEL = {};
|
||||||
|
|
||||||
|
@ -186,8 +186,8 @@ assert.AssertionError = AssertionError;
|
||||||
* @param {...any} args
|
* @param {...any} args
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function ok(...args) {
|
function assert(...args) {
|
||||||
innerOk(ok, args.length, ...args);
|
innerOk(assert, args.length, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -890,10 +890,8 @@ function strict(...args) {
|
||||||
innerOk(strict, args.length, ...args);
|
innerOk(strict, args.length, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(aduh95): take `ok` from `Assert.prototype` instead of a self-ref in a next major.
|
|
||||||
assert.ok = assert;
|
|
||||||
ArrayPrototypeForEach([
|
ArrayPrototypeForEach([
|
||||||
'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual',
|
'ok', 'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual',
|
||||||
'deepStrictEqual', 'notDeepStrictEqual', 'strictEqual',
|
'deepStrictEqual', 'notDeepStrictEqual', 'strictEqual',
|
||||||
'notStrictEqual', 'partialDeepStrictEqual', 'match', 'doesNotMatch',
|
'notStrictEqual', 'partialDeepStrictEqual', 'match', 'doesNotMatch',
|
||||||
'throws', 'rejects', 'doesNotThrow', 'doesNotReject', 'ifError',
|
'throws', 'rejects', 'doesNotThrow', 'doesNotReject', 'ifError',
|
||||||
|
|
|
@ -58,7 +58,7 @@ assert.strictEqual(
|
||||||
code: 'ENOENT',
|
code: 'ENOENT',
|
||||||
name: 'Error',
|
name: 'Error',
|
||||||
message: /^ENOENT: no such file or directory, access/,
|
message: /^ENOENT: no such file or directory, access/,
|
||||||
stack: /at async ok\.rejects/
|
stack: /at async assert\.rejects/
|
||||||
}
|
}
|
||||||
).then(common.mustCall());
|
).then(common.mustCall());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue