| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6626b16 commit 91f035e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,7 +83,7 @@ function lazyLoadComparison() { | |||
| 83 | 83 | // AssertionError's when particular conditions are not met. The | |
| 84 | 84 | // assert module must conform to the following interface. | |
| 85 | 85 | ||
| 86 | - const assert = module.exports = ok; | ||
| 86 | + module.exports = assert; | ||
| 87 | 87 | ||
| 88 | 88 | const NO_EXCEPTION_SENTINEL = {}; | |
| 89 | 89 | ||
@@ -186,8 +186,8 @@ assert.AssertionError = AssertionError; | |||
| 186 | 186 | * @param {...any} args | |
| 187 | 187 | * @returns {void} | |
| 188 | 188 | */ | |
| 189 | - function ok(...args) { | ||
| 190 | - innerOk(ok, args.length, ...args); | ||
| 189 | + function assert(...args) { | ||
| 190 | + innerOk(assert, args.length, ...args); | ||
| 191 | 191 | } | |
| 192 | 192 | ||
| 193 | 193 | /** | |
@@ -890,10 +890,8 @@ function strict(...args) { | |||
| 890 | 890 | innerOk(strict, args.length, ...args); | |
| 891 | 891 | } | |
| 892 | 892 | ||
| 893 | - // TODO(aduh95): take `ok` from `Assert.prototype` instead of a self-ref in a next major. | ||
| 894 | - assert.ok = assert; | ||
| 895 | 893 | ArrayPrototypeForEach([ | |
| 896 | - 'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual', | ||
| 894 | + 'ok', 'fail', 'equal', 'notEqual', 'deepEqual', 'notDeepEqual', | ||
| 897 | 895 | 'deepStrictEqual', 'notDeepStrictEqual', 'strictEqual', | |
| 898 | 896 | 'notStrictEqual', 'partialDeepStrictEqual', 'match', 'doesNotMatch', | |
| 899 | 897 | 'throws', 'rejects', 'doesNotThrow', 'doesNotReject', 'ifError', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ assert.strictEqual( | |||
| 58 | 58 | code: 'ENOENT', | |
| 59 | 59 | name: 'Error', | |
| 60 | 60 | message: /^ENOENT: no such file or directory, access/, | |
| 61 | - stack: /at async ok\.rejects/ | ||
| 61 | + stack: /at async assert\.rejects/ | ||
| 62 | 62 | } | |
| 63 | 63 | ).then(common.mustCall()); | |
| 64 | 64 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments