From 5bb20e1b13bf8730c21f609a5112a2e00f5bc2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Wed, 25 Dec 2024 19:36:28 +0200 Subject: [PATCH] test: browser tests to include project name --- test/browser/specs/benchmark.test.ts | 15 +++++++++++++-- test/browser/vitest.config.unit.mts | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/browser/specs/benchmark.test.ts b/test/browser/specs/benchmark.test.ts index 1b3eb94b5d7c..ed3d7dd2e1a2 100644 --- a/test/browser/specs/benchmark.test.ts +++ b/test/browser/specs/benchmark.test.ts @@ -1,10 +1,21 @@ import { expect, test } from 'vitest' import { runVitest } from '../../test-utils' +const IS_PLAYWRIGHT = process.env.PROVIDER === 'playwright' + test('benchmark', async () => { const result = await runVitest({ root: 'fixtures/benchmark' }, [], 'benchmark') expect(result.stderr).toReportNoErrors() - // TODO 2024-12-11 check |name| when it's supported - expect(result.stdout).toContain('✓ basic.bench.ts > suite-a') + + if (IS_PLAYWRIGHT) { + expect(result.stdout).toContain('✓ |chromium| basic.bench.ts > suite-a') + expect(result.stdout).toContain('✓ |firefox| basic.bench.ts > suite-a') + expect(result.stdout).toContain('✓ |webkit| basic.bench.ts > suite-a') + } + else { + expect(result.stdout).toContain('✓ |chrome| basic.bench.ts > suite-a') + expect(result.stdout).toContain('✓ |firefox| basic.bench.ts > suite-a') + } + expect(result.exitCode).toBe(0) }) diff --git a/test/browser/vitest.config.unit.mts b/test/browser/vitest.config.unit.mts index 8bcb174b0ae8..e217ab15ccd4 100644 --- a/test/browser/vitest.config.unit.mts +++ b/test/browser/vitest.config.unit.mts @@ -8,6 +8,7 @@ export default defineConfig({ singleFork: true, }, }, + reporters: 'verbose', setupFiles: ['./setup.unit.ts'], // 3 is the maximum of browser instances - in a perfect world they will run in parallel hookTimeout: process.env.CI ? 120_000 * 3 : 20_000,