GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — assert: fix throws and doesNotThrow stack frames · nodejs/node@c9d84b6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • assert.js
  • test/parallel
    • test-assert.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/assert.js‎

Copy file name to clipboardExpand all lines: lib/assert.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ function innerThrows(shouldThrow, block, expected, message) {
709709
expected,
710710
operator: 'throws',
711711
message: `Missing expected exception${details}`,
712-
stackStartFn: innerThrows
712+
stackStartFn: assert.throws
713713
});
714714
}
715715
if (expected && expectedException(actual, expected) === false) {
@@ -723,7 +723,7 @@ function innerThrows(shouldThrow, block, expected, message) {
723723
expected,
724724
operator: 'doesNotThrow',
725725
message: `Got unwanted exception${details}`,
726-
stackStartFn: innerThrows
726+
stackStartFn: assert.doesNotThrow
727727
});
728728
}
729729
throw actual;
Collapse file

‎test/parallel/test-assert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ testAssertionMessage({ a: NaN, b: Infinity, c: -Infinity },
603603
} catch (e) {
604604
threw = true;
605605
assert.strictEqual(e.message, 'Missing expected exception.');
606+
assert.ok(!e.stack.includes('throws'), e.stack);
606607
}
607608
assert.ok(threw);
608609
}
@@ -619,8 +620,8 @@ try {
619620
assert.strictEqual(1, 2, 'oh no'); // eslint-disable-line no-restricted-syntax
620621
} catch (e) {
621622
assert.strictEqual(e.message.split('\n')[0], 'oh no');
622-
// Message should not be marked as generated.
623-
assert.strictEqual(e.generatedMessage, false);
623+
assert.strictEqual(e.generatedMessage, false,
624+
'Message incorrectly marked as generated');
624625
}
625626

626627
{

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.