chore: set up MSW

This will help with mocking requests and responses from external services.
This commit is contained in:
2024-05-15 09:22:12 -04:00
parent 1e1729ae30
commit 695a1bb4cd
5 changed files with 9 additions and 4 deletions

5
.gitignore vendored
View File

@@ -1,7 +1,4 @@
node_modules
dist
.wrangler
.dev.vars
# Change them to your taste:
bun.lockb
.dev.vars

BIN
bun.lockb Executable file

Binary file not shown.

View File

@@ -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
View File

@@ -0,0 +1 @@
export const handlers = [];

5
src/mocks/index.ts Normal file
View File

@@ -0,0 +1,5 @@
import { setupServer } from "msw/node";
import { handlers } from "./handlers";
export const server = setupServer(...handlers);