perf-budgets reports only for a project that runs Playwright (a new starter site has no e2e yet)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-12-01 14:29:17 +01:00
co-authored by Claude Opus 5.5
parent 3b32e659c5
commit 6b16b9f933
4 changed files with 13 additions and 2 deletions
+7
View File
@@ -53,6 +53,7 @@ describe('doctor: performance group (static)', () => {
test('images config, fonts, render-blocking, embeds, animations and a missing budget test are reported', async () => {
const root = project({
'next.config.ts': 'export default { images: { remotePatterns: [] } }',
'playwright.config.ts': 'export default {}',
'src/app/(frontend)/[locale]/layout.tsx': [
"import { Fraunces, Inter, Lora } from 'next/font/google'",
"const a = Inter({ display: 'block' })",
@@ -94,6 +95,12 @@ describe('doctor: performance group (static)', () => {
})
})
test('perf-budgets: only for a project that already runs Playwright', async () => {
const files = { 'next.config.ts': 'buildImagesConfig()' }
expect(await found(project(files), ['perf-budgets'])).toEqual([])
expect(await found(project({ ...files, 'playwright.config.ts': '' }), ['perf-budgets'])).toHaveLength(1)
})
describe('doctor: performance group (deep and live)', () => {
test('perf-images: stored images over the limits', async () => {
const root = project({})