build(tools): set up testing tools

This commit is contained in:
Marc 2024-02-19 12:28:19 -05:00
parent e2a5e593e9
commit 04043d18dc
Signed by: marc
GPG key ID: 048E042F22B5DC79
5 changed files with 1225 additions and 1401 deletions

View file

@ -11,7 +11,9 @@
"start": "netlify dev", "start": "netlify dev",
"start:app": "vite ./src --config ./vite.config.js --port 8080", "start:app": "vite ./src --config ./vite.config.js --port 8080",
"build": "vite build ./src --config ./vite.config.js --emptyOutDir", "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": { "dependencies": {
"@emotion/react": "^11.11.3", "@emotion/react": "^11.11.3",
@ -27,14 +29,19 @@
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.5.3", "@biomejs/biome": "^1.5.3",
"@netlify/functions": "^2.6.0", "@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": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-legacy": "^5.3.0", "@vitejs/plugin-legacy": "^5.3.0",
"jest": "29.3.1", "jsdom": "^24.0.0",
"netlify-cli": "^17.16.2", "netlify-cli": "^17.16.2",
"terser": "^5.27.1", "terser": "^5.27.1",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.1.3" "vite": "^5.1.3",
"vitest": "^1.3.0"
} }
} }

2
testSetup.ts Normal file
View file

@ -0,0 +1,2 @@
import { vi } from "vitest";
import "@testing-library/jest-dom";

View file

@ -9,7 +9,10 @@
"rootDir": ".", "rootDir": ".",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
} },
"types": [
"@testing-library/jest-dom"
]
}, },
"include": ["src/**/*", "netlify/**/*"] "include": ["src/**/*", "netlify/**/*"]
} }

View file

@ -18,7 +18,7 @@ export default defineConfig({
}, },
test: { test: {
environment: "jsdom", environment: "jsdom",
//setupFiles: ["./src/tests/testSetup.ts"], setupFiles: ["./testSetup.ts"],
include: ["./src/**/*.test.ts", "./src/**/*.test.tsx"], include: ["./src/**/*.test.ts", "./src/**/*.test.tsx"],
globals: true, globals: true,
}, },

2604
yarn.lock

File diff suppressed because it is too large Load diff