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: show proper differences · nodejs/node@5e6b42e

File tree

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

‎lib/internal/errors.js‎

Copy file name to clipboardExpand all lines: lib/internal/errors.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ function createErrDiff(actual, expected, operator) {
9090
var skipped = false;
9191
const util = lazyUtil();
9292
const actualLines = util
93-
.inspect(actual, { compact: false }).split('\n');
93+
.inspect(actual, { compact: false, customInspect: false }).split('\n');
9494
const expectedLines = util
95-
.inspect(expected, { compact: false }).split('\n');
95+
.inspect(expected, { compact: false, customInspect: false }).split('\n');
9696
const msg = `Input A expected to ${operator} input B:\n` +
9797
`${green}+ expected${white} ${red}- actual${white}`;
9898
const skippedMsg = ' ... Lines skipped';
@@ -235,8 +235,10 @@ class AssertionError extends Error {
235235
} else if (errorDiff === 1) {
236236
// In case the objects are equal but the operator requires unequal, show
237237
// the first object and say A equals B
238-
const res = util
239-
.inspect(actual, { compact: false }).split('\n');
238+
const res = util.inspect(
239+
actual,
240+
{ compact: false, customInspect: false }
241+
).split('\n');
240242

241243
if (res.length > 20) {
242244
res[19] = '...';
Collapse file

‎test/parallel/test-assert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,11 @@ common.expectsError(
899899
message: `${start}\n` +
900900
`${actExp}\n` +
901901
'\n' +
902-
' {}'
902+
`${minus} {}\n` +
903+
`${plus} {\n` +
904+
`${plus} loop: 'forever',\n` +
905+
`${plus} [Symbol(util.inspect.custom)]: [Function]\n` +
906+
`${plus} }`
903907
});
904908

905909
// notDeepEqual tests

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.