Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit 6747387

Browse files
committed
test: enhance snapshots for cypress tests
1 parent 326db73 commit 6747387

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

__snapshots__/cypress.spec.ts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ Fix the error in your code and re-run your tests.
161161
162162
Spec Tests Passing Failing Pending Skipped
163163
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
164-
│ ✖ compile-error.spec.js ***ms - - 1 - - │
164+
│ ✖ compile-error.spec.js ***ms - - 1 - - │
165165
├────────────────────────────────────────────────────────────────────────────────────────────────┤
166166
│ ✖ fail.spec.js ***ms 1 - 1 - - │
167167
├────────────────────────────────────────────────────────────────────────────────────────────────┤
168-
│ ✖ pass.spec.js ***ms 1 - 1 - - │
168+
│ ✖ pass.spec.js ***ms 1 - 1 - - │
169169
├────────────────────────────────────────────────────────────────────────────────────────────────┤
170-
│ ✖ runtime-error.spec.js ***ms 1 - 1 - - │
170+
│ ✖ runtime-error.spec.js ***ms 1 - 1 - - │
171171
└────────────────────────────────────────────────────────────────────────────────────────────────┘
172172
✖ 4 of 4 failed (100%) ***ms 3 - 4 - -
173173

test/e2e/cypress.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ describe('cypress - e2e', async () => {
2020

2121
function sanitizeOutput (output: string): string {
2222
return output
23-
.replace(/\d+ms/g, '***ms')
2423
.replace(/localhost:\d+/g, 'localhost:****')
25-
.replace(/Cypress: {4}\d+.\d+.\d+/g, 'Cypress: *.*.*')
26-
.replace(/Browser: {4}Electron \d+/g, 'Browser: Electron **')
24+
.replace(/Cypress: \d+.\d+.\d+.+/g, 'Cypress: *.*.* │')
25+
.replace(/Browser: +Electron \d+.+/g, 'Browser: Electron ** (headless) │')
26+
.replace(/compile-error.spec.js .+ms/, 'compile-error.spec.js ***ms'.trim())
27+
.replace(/fail.spec.js .+ms/, ' fail.spec.js ***ms'.trim())
28+
.replace(/pass.spec.js .+ms/, ' pass.spec.js ***ms'.trim())
29+
.replace(/runtime-error.spec.js .+ms/, 'runtime-error.spec.js ***ms'.trim())
30+
.replace(/\d+ms/g, '***ms')
2731
}

0 commit comments

Comments
 (0)