MCPcopy
hub / github.com/mswjs/msw / TestFixtures

Interface TestFixtures

test/browser/playwright.extend.ts:30–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28import { WebSocketServer } from '../support/WebSocketServer'
29
30export interface TestFixtures {
31 /**
32 * Create a test server instance.
33 */
34 createServer(...middleware: Array<HttpServerMiddleware>): Promise<HttpServer>
35 webpackServer: WebpackHttpServer
36 loadExample(
37 entry: string | Array<string> | URL,
38 options?: CompilationOptions & {
39 /**
40 * Do not await the "Mocking enabled" message in the console.
41 */
42 skipActivation?: boolean
43 beforeNavigation?(compilation: Compilation): void
44 },
45 ): Promise<{
46 compilation: Compilation
47 workerConsole: WorkerConsole
48 }>
49 fetch(
50 url: string | URL,
51 init?: RequestInit,
52 options?: FetchOptions,
53 ): Promise<Response>
54 query(uri: string, options: GraphQLQueryOptions): Promise<Response>
55 makeUrl(path: string): string
56 spyOnConsole(page?: Page): ConsoleMessages
57 waitFor(predicate: () => unknown): Promise<void>
58 waitForMswActivation(): Promise<void>
59 defineWebSocketServer(): Promise<WebSocketServer>
60}
61
62interface FetchOptions {
63 page?: Page

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…