Skip to content

Commit

Permalink
clarify stack regex in results_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cacieprins committed Dec 20, 2024
1 parent fb1219c commit ea57654
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion system-tests/test/results_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const archRegex = /"arch": "[^"]+"/g
const versionRegex = /"(browserVersion|cypressVersion|osVersion|resolvedNodeVersion|version)": "[^"]+"/g
const majorVersionRegex = /"(majorVersion)": [0-9]+/g
const pathRegex = /"(absolute|projectRoot|downloadsFolder|fileServerFolder|fixturesFolder|resolvedNodePath|screenshotsFolder|videosFolder|cypressBinaryRoot|path)": "[^"]+"/g
// matches similar to: `\n at SOME_CODEPATH"`
const stackLineRegex = /(\Wn {4}at.+)"/g

/**
* normalize dynamic data in results json like dates, paths, durations, etc
* @param {string} resultsJson input string
Expand All @@ -24,7 +27,7 @@ const normalizeResults = (resultsJson) => {
.replace(majorVersionRegex, '"$1": "X"')
.replace(osNameRegex, '"$1": "linux"')
.replace(archRegex, '"arch": "x64"')
.replace(/(\Wn {4}at.+)"/g, ' <stack lines>"')
.replace(stackLineRegex, ' <stack lines>"')
}

const normalizeBrowsers = (browsers) => {
Expand Down

0 comments on commit ea57654

Please sign in to comment.