install playwright-msw to enable override of routes in tests

This commit is contained in:
Jacob Overgaard
2022-08-08 14:09:15 +02:00
parent 0a56307553
commit 3f3ef55fbf
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { expect, test as base } from '@playwright/test';
import { createWorkerFixture } from 'playwright-msw';
import { handlers } from './src/mocks/handlers';
import type { MockServiceWorker } from 'playwright-msw';
const test = base.extend<{
worker: MockServiceWorker;
}>({
worker: createWorkerFixture(...handlers),
});
export { test, expect };