diff --git a/integration/base.ts b/integration/base.ts index 5e2c8b9..bfd6c3e 100644 --- a/integration/base.ts +++ b/integration/base.ts @@ -1,4 +1,10 @@ -import { type Fixtures, type PlaywrightTestArgs, type PlaywrightTestOptions, test as baseTest } from '@playwright/test' +import { + type Fixtures, + type PlaywrightTestArgs, + type PlaywrightTestOptions, + test as baseTest, + expect, +} from '@playwright/test' export { expect } from '@playwright/test' @@ -6,6 +12,17 @@ const appFixtures: Fixtures, Record, Playwrig baseURL: async ({}, use) => { await use('http://localhost:3000') }, + context: async ({ context }, use) => { + const errors: Array = [] + + context.on('weberror', error => { + errors.push(error.error().message) + }) + + await use(context) + + expect(errors).toHaveLength(0) + }, } export const test = baseTest.extend(appFixtures)