Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

require('../common');
require('../../common');
const assert = require('assert/strict');

assert.throws(() => { throw new Error('foo'); }, { bar: true });
29 changes: 29 additions & 0 deletions test/fixtures/errors/assert_throws_stack.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
node:assert:<line>
throw err;
^

AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

+ Comparison {}
- Comparison {
- bar: true
- }

at Object.<anonymous> (<project-root>/test/fixtures/errors/assert_throws_stack.js:6:8)
at <node-internal-frames>
at <node-internal-frames> {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: Error: foo
at assert.throws.bar (<project-root>/test/fixtures/errors/assert_throws_stack.js:6:29)
at <node-internal-frames>
at Object.<anonymous> (<project-root>/test/fixtures/errors/assert_throws_stack.js:6:8)
at <node-internal-frames>
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24),
expected: { bar: true },
operator: 'throws',
diff: 'simple'
}

Node.js <node-version>
39 changes: 0 additions & 39 deletions test/message/assert_throws_stack.out

This file was deleted.

1 change: 1 addition & 0 deletions test/parallel/test-node-output-errors.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('errors output', { concurrency: !process.env.TEST_PARALLEL }, () => {
{ name: 'errors/async_error_microtask_main.js' },
{ name: 'errors/async_error_nexttick_main.js' },
{ name: 'errors/async_error_sync_main.js' },
{ name: 'errors/assert_throws_stack.js' },
{ name: 'errors/core_line_numbers.js' },
{ name: 'errors/async_error_sync_esm.mjs' },
{ name: 'errors/test-no-extra-info-on-fatal-exception.js' },
Expand Down
Loading