Skip to content

Commit

Permalink
chore(withHandlers): describe the function
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed May 25, 2024
1 parent b7d1ef4 commit c8ef7b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/support/withHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { RequestHandler } from 'msw'
import { setupServer } from 'msw/node'

/**
* Creates an MSW `server` instance, populates it
* with the given `handlers`, runs the `callback`,
* and cleans up afterward.
*/
export async function withHandlers<R>(
handlers: Array<RequestHandler>,
callback: () => Promise<R>,
Expand Down

0 comments on commit c8ef7b7

Please sign in to comment.