chore: set up MSW
This will help with mocking requests and responses from external services.
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,7 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.wrangler
|
||||
.dev.vars
|
||||
|
||||
# Change them to your taste:
|
||||
bun.lockb
|
||||
.dev.vars
|
||||
@@ -12,8 +12,10 @@
|
||||
"@cloudflare/workers-types": "^4.20240403.0",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"@types/bun": "^1.1.2",
|
||||
"msw": "^2.3.0",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-toml": "^2.0.1",
|
||||
"typescript": "^5.4.5",
|
||||
"wrangler": "^3.47.0"
|
||||
}
|
||||
}
|
||||
|
||||
1
src/mocks/handlers.ts
Normal file
1
src/mocks/handlers.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const handlers = [];
|
||||
5
src/mocks/index.ts
Normal file
5
src/mocks/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { setupServer } from "msw/node";
|
||||
|
||||
import { handlers } from "./handlers";
|
||||
|
||||
export const server = setupServer(...handlers);
|
||||
Reference in New Issue
Block a user