chore: clear message for no reports (#23492)

This commit is contained in:
Yury Semikhatsky 2023-06-05 17:20:54 -07:00 committed by GitHub
parent 3a00fc4edf
commit ceaa29cec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,8 @@ import { Multiplexer } from './multiplexer';
export async function createMergedReport(config: FullConfigInternal, dir: string, reporterDescriptions: ReporterDescription[], resolvePaths: boolean) {
const shardFiles = await sortedShardFiles(dir);
if (shardFiles.length === 0)
throw new Error(`No report files found in ${dir}`);
const events = await mergeEvents(dir, shardFiles);
if (resolvePaths)
patchAttachmentPaths(events, dir);

View File

@ -965,3 +965,11 @@ test('same project different suffixes', async ({ runInlineTest, mergeReports })
expect(exitCode).toBe(0);
expect(output).toContain(`projects: [ 'foo-first', 'foo-second' ]`);
});
test('no reports error', async ({ runInlineTest, mergeReports }) => {
const reportDir = test.info().outputPath('blob-report');
fs.mkdirSync(reportDir, { recursive: true });
const { exitCode, output } = await mergeReports(reportDir);
expect(exitCode).toBe(1);
expect(output).toContain(`No report files found in`);
});