chore: hide 'markdown' reporter (#33140)

This commit is contained in:
Max Schmitt 2024-10-18 23:00:05 +02:00 committed by GitHub
parent 2e8e7a66cd
commit b1fb4f16a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
export default {
testDir: '../../tests',
reporter: [['markdown'], ['html']]
reporter: [[require.resolve('../../packages/playwright/lib/reporters/markdown')], ['html']]
};

View File

@ -276,7 +276,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';

View File

@ -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';
@ -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;

View File

@ -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': `
@ -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': `
@ -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': `
@ -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': `