@@ -6,14 +6,7 @@ import type { NuxtApp } from '#app'
66
77export type TNuxtMswWorkerOptions = {
88 /**
9- * Indicate baseURL of Nuxt server. e.g: `http://localhost:3000`
10- * Required if you use `useFetch` or `$fetch` with relative URL in your app.
11- */
12- baseURL ?: string
13- /**
14- * Define the handlers passed to `setupWorker()` and `setupServer()`.
15- *
16- * You can pass different handlers for client-side and server-side.
9+ * Define the handlers passed to `setupWorker()`.
1710 *
1811 * - See [Dynamic Mocking](https://mswjs.io/docs/best-practices/dynamic-mock-scenarios)
1912 * - See [setupWorker](https://mswjs.io/docs/api/setup-worker)
@@ -41,13 +34,10 @@ export type TNuxtMswServerOptions = {
4134 * Indicate baseURL of Nuxt server. e.g: `http://localhost:3000`
4235 * Required if you use `useFetch` or `$fetch` with relative URL in your app.
4336 */
44- baseURL ? : string
37+ baseURL : string
4538 /**
46- * Define the handlers passed to `setupWorker()` and `setupServer()`.
47- *
48- * You can pass different handlers for client-side and server-side.
39+ * Define the handlers passed to `setupServer()`.
4940 *
50- * - See [Dynamic Mocking](https://mswjs.io/docs/best-practices/dynamic-mock-scenarios)
5141 * - See [setupServer](https://mswjs.io/docs/api/setup-server)
5242 */
5343 handlers : HttpHandler [ ]
@@ -72,7 +62,7 @@ export type TNuxtMswServerOptions = {
7262 * @param event H3Event. See [H3](https://h3.unjs.io)
7363 * @returns
7464 */
75- afterResponse ?: ( server : SetupServerApi , event : H3Event ) => void | Promise < void >
65+ // afterResponse?: (server: SetupServerApi, event: H3Event) => void | Promise<void>
7666}
7767
7868/**
@@ -102,7 +92,25 @@ export const defineNuxtMswServerOption = (
10292 : ( ) => options
10393}
10494
105- export type TNuxtMswTestOptions = Pick < TNuxtMswServerOptions , 'handlers' | 'serverOptions' | 'baseURL' >
95+ export type TNuxtMswTestOptions = {
96+ /**
97+ * Any baseURL, for mocking $fetch and useFetch. e.g: `http://localhost:3000`
98+ * Required if you use `useFetch` or `$fetch` with relative URL in your app.
99+ */
100+ baseURL ?: string
101+
102+ /**
103+ * Define the handlers passed to `setupServer()`.
104+ */
105+ handlers ?: HttpHandler [ ]
106+
107+ /**
108+ * Options for the `server.listen()`.
109+ *
110+ * See https://mswjs.io/docs/api/setup-server/listen
111+ */
112+ serverOptions ?: Partial < SharedOptions >
113+ }
106114/**
107115 *
108116 * Defines the Nuxt MSW Server option when working with `@nuxt/test-utils`.
0 commit comments