You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `registerEndpoint` allows you create Nitro endpoint that returns mocked data. It can come in handy if you want to test a component that makes requests to API to display some data.
23
24
* @param url - endpoint name (e.g. `/test/`).
24
-
* @param options - factory function that returns the mocked data or an object containing both the `handler` and the `method` properties.
25
+
* @param options - factory function that returns the mocked data or an object containing the `handler`, `method`, and `once` properties.
26
+
* - `handler`: the event handler function
27
+
* - `method`: (optional) HTTP method to match (e.g., 'GET', 'POST')
28
+
* - `once`: (optional) if true, the handler will only be used for the first matching request and then automatically removed
25
29
* @example
26
30
* ```ts
27
31
* import { registerEndpoint } from '@nuxt/test-utils/runtime'
0 commit comments