Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: hide 'markdown' reporter #33140

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/merge.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
testDir: '../../tests',
reporter: [['markdown'], ['html']]
reporter: [[require.resolve('../../packages/playwright/lib/reporters/markdown')], ['html']]
};
2 changes: 1 addition & 1 deletion packages/playwright/src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export function toReporters(reporters: BuiltInReporter | ReporterDescription[] |
return reporters;
}

export const builtInReporters = ['list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob', 'markdown'] as const;
export const builtInReporters = ['list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob'] as const;
export type BuiltInReporter = typeof builtInReporters[number];

export type ContextReuseMode = 'none' | 'when-possible';
Expand Down
2 changes: 0 additions & 2 deletions packages/playwright/src/runner/reporters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import JSONReporter from '../reporters/json';
import JUnitReporter from '../reporters/junit';
import LineReporter from '../reporters/line';
import ListReporter from '../reporters/list';
import MarkdownReporter from '../reporters/markdown';
import type { Suite } from '../common/test';
import type { BuiltInReporter, FullConfigInternal } from '../common/config';
import { loadReporter } from './loadUtils';
Expand All @@ -45,7 +44,6 @@ export async function createReporters(config: FullConfigInternal, mode: 'list' |
junit: JUnitReporter,
null: EmptyReporter,
html: HtmlReporter,
markdown: MarkdownReporter,
};
const reporters: ReporterV2[] = [];
descriptions ??= config.config.reporter;
Expand Down
10 changes: 6 additions & 4 deletions tests/playwright-test/reporter-markdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import fs from 'fs';
import path from 'path';
import { expect, test } from './playwright-test-fixtures';

const markdownReporter = require.resolve('../../packages/playwright/lib/reporters/markdown');

test('simple report', async ({ runInlineTest }) => {
const files = {
'playwright.config.ts': `
module.exports = {
retries: 1,
reporter: 'markdown',
reporter: ${JSON.stringify(markdownReporter)},
};
`,
'dir1/a.test.js': `
Expand Down Expand Up @@ -83,7 +85,7 @@ test('custom report file', async ({ runInlineTest }) => {
const files = {
'playwright.config.ts': `
module.exports = {
reporter: [['markdown', { outputFile: 'my-report.md' }]],
reporter: [[${JSON.stringify(markdownReporter)}, { outputFile: 'my-report.md' }]],
};
`,
'a.test.js': `
Expand All @@ -107,7 +109,7 @@ test('report error without snippet', async ({ runInlineTest }) => {
'playwright.config.ts': `
module.exports = {
retries: 1,
reporter: 'markdown',
reporter: ${JSON.stringify(markdownReporter)},
};
`,
'a.test.js': `
Expand Down Expand Up @@ -135,7 +137,7 @@ test('report with worker error', async ({ runInlineTest }) => {
'playwright.config.ts': `
module.exports = {
retries: 1,
reporter: 'markdown',
reporter: ${JSON.stringify(markdownReporter)},
};
`,
'a.test.js': `
Expand Down
Loading