fix for enabling turning off stripping ansi for that 1 special reporter test

This commit is contained in:
Brian Mann
2023-08-28 16:45:33 -07:00
parent 8a60770624
commit 3a441c5da1
2 changed files with 11 additions and 3 deletions

View File

@@ -142,6 +142,10 @@ type ExecOptions = {
* If set, automatically snapshot the test's stdout.
*/
snapshot?: boolean
/**
* By default strip ansi codes from stdout. Pass false to turn off.
*/
stripAnsi?: boolean
/**
* Pass a function to assert on and/or modify the stdout before snapshotting.
*/
@@ -636,6 +640,7 @@ const systemTests = {
timeout: 120000,
originalTitle: null,
expectedExitCode: 0,
stripAnsi: true,
sanitizeScreenshotDimensions: false,
normalizeStdoutAvailableBrowsers: true,
noExit: process.env.NO_EXIT,
@@ -852,9 +857,11 @@ const systemTests = {
}
})
// always strip ansi from stdout before yielding
// it to any callback functions
stdout = stripAnsi(stdout)
if (options.stripAnsi) {
// always strip ansi from stdout before yielding
// it to any callback functions
stdout = stripAnsi(stdout)
}
// snapshot the stdout!
if (options.snapshot) {

View File

@@ -187,6 +187,7 @@ describe('e2e reporters', () => {
return systemTests.exec(this, {
spec: 'slowTestThreshold.cy.js',
snapshot: false,
stripAnsi: false,
config: {
slowTestThreshold: 1,
},