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 — test: fix snapshot tests when cwd contains spaces or backslashes · nodejs/node@b4ca4a6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • assertSnapshot.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/assertSnapshot.js‎

Copy file name to clipboardExpand all lines: test/common/assertSnapshot.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const test = require('node:test');
55
const fs = require('node:fs/promises');
66
const assert = require('node:assert/strict');
77

8-
const stackFramesRegexp = /(\s+)((.+?)\s+\()?(?:\(?(.+?):(\d+)(?::(\d+))?)\)?(\s+\{)?(\[\d+m)?(\n|$)/g;
8+
const stackFramesRegexp = /(?<=\n)(\s+)((.+?)\s+\()?(?:\(?(.+?):(\d+)(?::(\d+))?)\)?(\s+\{)?(\[\d+m)?(\n|$)/g;
99
const windowNewlineRegexp = /\r/g;
1010

1111
function replaceStackTrace(str, replacement = '$1*$7$8\n') {
@@ -17,7 +17,7 @@ function replaceWindowsLineEndings(str) {
1717
}
1818

1919
function replaceWindowsPaths(str) {
20-
return str.replaceAll(path.win32.sep, path.posix.sep);
20+
return common.isWindows ? str.replaceAll(path.win32.sep, path.posix.sep) : str;
2121
}
2222

2323
function transform(...args) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.