Skip to content

Commit fe2fa33

Browse files
fix(workspace): fix test
1 parent c26f496 commit fe2fa33

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

e2e/cli-e2e/tests/collect/format.e2e.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { join } from 'node:path';
55
import { CliTest, DEFAULT_RC, USER_FLOW_MOCKS } from '../../utils/setup';
66

77
const DUMMY_USER_FLOW_NAME = 'Basic Navigation Example';
8+
const MOCK_MD_REPORT_HEADER = '| Gather Mode | Performance | Accessibility | Best Practices | Seo |';
89

910
describe('collect format', () => {
1011
['html', 'json', 'md'].forEach((format) => {
@@ -33,7 +34,7 @@ describe('collect format', () => {
3334

3435
const { code, stdout, stderr } = await cli.run('user-flow', ['collect']);
3536

36-
expect(stdout).toContain(`| Gather Mode | Performance | Accessibility | Best Practices | Seo |`)
37+
expect(stdout).toContain(MOCK_MD_REPORT_HEADER)
3738
expect(stdout).toContain(DUMMY_USER_FLOW_NAME);
3839
expect(stderr).toBe('');
3940
expect(code).toBe(0);
@@ -54,7 +55,7 @@ describe('collect format', () => {
5455
expect(isValidFormatedResult(format, content)).toBeTruthy();
5556
});
5657

57-
expect(stdout).toContain(`| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |`)
58+
expect(stdout).toContain(MOCK_MD_REPORT_HEADER)
5859
expect(stdout).toContain(DUMMY_USER_FLOW_NAME);
5960
expect(stderr).toBe('');
6061
expect(code).toBe(0);
@@ -66,7 +67,7 @@ function isValidFormatedResult(format: string, result: string) {
6667
const isValidFile = {
6768
'html': (report: string) => report.includes(DUMMY_USER_FLOW_NAME),
6869
'json': (report: string) => !!(JSON.parse(report)?.name || '').includes(DUMMY_USER_FLOW_NAME),
69-
'md': (report: string) => report.includes(`| Gather Mode | Performance | Accessibility | Best Practices | Seo |`)
70+
'md': (report: string) => report.includes(MOCK_MD_REPORT_HEADER)
7071
};
7172
// @ts-ignore
7273
return isValidFile[format](result);

0 commit comments

Comments
 (0)