Skip to content

Commit 1552a67

Browse files
lib: convert Assert class to a constructor function type
1 parent af1765c commit 1552a67

12 files changed

+677
-704
lines changed

lib/assert.js

Lines changed: 666 additions & 670 deletions
Large diffs are not rendered by default.

test/fixtures/errors/error_exit.snapshot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Exiting with code=1
22
node:assert:*
3-
throw new AssertionError(this.#buildAssertionErrorOptions(obj));
4-
^
3+
throw new AssertionError(_buildAssertionErrorOptions(this, obj));
4+
^
55

66
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
77

88
1 !== 2
99

10-
at new AssertionError (node:internal*assert*assertion_error:*:*) {
10+
at Object.<anonymous> (*error_exit.js:*:*) {
1111
generatedMessage: true,
1212
code: 'ERR_ASSERTION',
1313
actual: 1,

test/fixtures/errors/if-error-has-good-stack.snapshot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
node:assert:*
2-
throw newErr;
3-
^
2+
throw newErr;
3+
^
44

55
AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
6-
at new AssertionError (node:internal*assert*assertion_error:*:*)
7-
at Assert.ifError (node:assert:*:*)
86
at z (*if-error-has-good-stack.js:*:*)
97
at y (*if-error-has-good-stack.js:*:*)
8+
at x (*if-error-has-good-stack.js:*:*)
9+
at Object.<anonymous> (*if-error-has-good-stack.js:*:*)
1010
at c (*if-error-has-good-stack.js:*:*)
1111
at b (*if-error-has-good-stack.js:*:*)
1212
at a (*if-error-has-good-stack.js:*:*)

test/fixtures/test-runner/output/describe_it.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ not ok 14 - async assertion fail
154154
*
155155
*
156156
*
157-
*
158-
*
159-
*
160157
...
161158
# Subtest: resolve pass
162159
ok 15 - resolve pass

test/fixtures/test-runner/output/dot_reporter.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ Failed tests:
6161
*
6262
*
6363
*
64-
*
65-
*
66-
*
6764
* {
6865
generatedMessage: true,
6966
code: 'ERR_ASSERTION',

test/fixtures/test-runner/output/junit_reporter.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ true !== false
119119
*
120120
*
121121
*
122-
*
123-
*
124-
*
125122
* {
126123
generatedMessage: true,
127124
code: 'ERR_ASSERTION',

test/fixtures/test-runner/output/output.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ not ok 13 - async assertion fail
157157
*
158158
*
159159
*
160-
*
161-
*
162-
*
163160
...
164161
# Subtest: resolve pass
165162
ok 14 - resolve pass

test/fixtures/test-runner/output/output_cli.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ not ok 13 - async assertion fail
157157
*
158158
*
159159
*
160-
*
161-
*
162-
*
163160
...
164161
# Subtest: resolve pass
165162
ok 14 - resolve pass

test/fixtures/test-runner/output/source_mapped_locations.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ not ok 1 - fails
2222
*
2323
*
2424
*
25-
*
26-
*
27-
*
2825
...
2926
1..1
3027
# tests 1

test/fixtures/test-runner/output/spec_reporter.snapshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@
166166
*
167167
*
168168
*
169-
*
170-
*
171-
*
172169
* {
173170
generatedMessage: true,
174171
code: 'ERR_ASSERTION',

0 commit comments

Comments
 (0)