Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function lazyLoadComparison() {
// AssertionError's when particular conditions are not met. The
// assert module must conform to the following interface.

const assert = module.exports = ok;
module.exports = assert;

const NO_EXCEPTION_SENTINEL = {};

Expand Down Expand Up @@ -186,8 +186,8 @@ assert.AssertionError = AssertionError;
* @param {...any} args
* @returns {void}
*/
function ok(...args) {
innerOk(ok, args.length, ...args);
function assert(...args) {
innerOk(assert, args.length, ...args);
}

/**
Expand Down Expand Up @@ -890,10 +890,8 @@ function strict(...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([
'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual',
'ok', 'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual',
'deepStrictEqual', 'notDeepStrictEqual', 'strictEqual',
'notStrictEqual', 'partialDeepStrictEqual', 'match', 'doesNotMatch',
'throws', 'rejects', 'doesNotThrow', 'doesNotReject', 'ifError',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ assert.strictEqual(
code: 'ENOENT',
name: 'Error',
message: /^ENOENT: no such file or directory, access/,
stack: /at async ok\.rejects/
stack: /at async assert\.rejects/
}
).then(common.mustCall());

Expand Down
Loading