build(tools): set up testing tools
This commit is contained in:
parent
e2a5e593e9
commit
04043d18dc
5 changed files with 1225 additions and 1401 deletions
13
package.json
13
package.json
|
@ -11,7 +11,9 @@
|
|||
"start": "netlify dev",
|
||||
"start:app": "vite ./src --config ./vite.config.js --port 8080",
|
||||
"build": "vite build ./src --config ./vite.config.js --emptyOutDir",
|
||||
"build:watch": "vite build watch ./src --config ./vite.config.js"
|
||||
"build:watch": "vite build watch ./src --config ./vite.config.js",
|
||||
"test:watch": "vitest --config ./vite.config.js",
|
||||
"test": "vitest run --config ./vite.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.3",
|
||||
|
@ -27,14 +29,19 @@
|
|||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.5.3",
|
||||
"@netlify/functions": "^2.6.0",
|
||||
"@testing-library/dom": "^9.3.4",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.1",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@vitejs/plugin-basic-ssl": "^1.1.0",
|
||||
"@vitejs/plugin-legacy": "^5.3.0",
|
||||
"jest": "29.3.1",
|
||||
"jsdom": "^24.0.0",
|
||||
"netlify-cli": "^17.16.2",
|
||||
"terser": "^5.27.1",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.1.3"
|
||||
"vite": "^5.1.3",
|
||||
"vitest": "^1.3.0"
|
||||
}
|
||||
}
|
||||
|
|
2
testSetup.ts
Normal file
2
testSetup.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
import { vi } from "vitest";
|
||||
import "@testing-library/jest-dom";
|
|
@ -9,7 +9,10 @@
|
|||
"rootDir": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"types": [
|
||||
"@testing-library/jest-dom"
|
||||
]
|
||||
},
|
||||
"include": ["src/**/*", "netlify/**/*"]
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export default defineConfig({
|
|||
},
|
||||
test: {
|
||||
environment: "jsdom",
|
||||
//setupFiles: ["./src/tests/testSetup.ts"],
|
||||
setupFiles: ["./testSetup.ts"],
|
||||
include: ["./src/**/*.test.ts", "./src/**/*.test.tsx"],
|
||||
globals: true,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue