There is a convention that all tests should be tun on pnpm test
, not just unit tests. The idea behind this approach is to have a simple command to test everything.
This is why I suggest these scripts:
"scripts": {
"dev-ui": "vite build --watch -c vite.config.ui.ts",
"dev-bg": "vite build --watch -c vite.config.bg.ts",
"dev": "pnpm run dev-ui & pnpm run dev-bg",
"build-ui": "tsc && vite build -c vite.config.ui.ts",
"build-bg": "tsc && vite build -c vite.config.bg.ts",
"build": "pnpm run build-ui && pnpm run build-bg",
"prettier:format": "prettier --write ./",
"eslint": "eslint --ext .ts,.tsx ./src --fix",
"tsc": "tsc --skipLibCheck --noEmit",
"test-ui": "vitest --watch=false --coverage -c vite.config.ui.ts",
"test-bg": "vitest --watch=false --coverage -c vite.config.bg.ts",
- "test": "pnpm run test-ui && pnpm run test-bg"
+ "test": "pnpm run eslint && pnpm run tsc && pnpm run test-ui && pnpm run test-bg"
},
Or we can even run all tests in parallel:
"scripts": {
"dev-ui": "vite build --watch -c vite.config.ui.ts",
"dev-bg": "vite build --watch -c vite.config.bg.ts",
"dev": "pnpm run dev-ui & pnpm run dev-bg",
"build-ui": "tsc && vite build -c vite.config.ui.ts",
"build-bg": "tsc && vite build -c vite.config.bg.ts",
"build": "pnpm run build-ui && pnpm run build-bg",
"prettier:format": "prettier --write ./",
- "test": "pnpm run test-ui && pnpm run test-bg"
- "eslint": "eslint --ext .ts,.tsx ./src --fix",
- "tsc": "tsc --skipLibCheck --noEmit",
- "test-ui": "vitest --watch=false --coverage -c vite.config.ui.ts",
- "test-bg": "vitest --watch=false --coverage -c vite.config.bg.ts",
+ "test:lint": "eslint --ext .ts,.tsx ./src --fix",
+ "test:types": "tsc --skipLibCheck --noEmit",
+ "test:unit:ui": "vitest --watch=false --coverage -c vite.config.ui.ts",
+ "test:unit:bg": "vitest --watch=false --coverage -c vite.config.bg.ts",
+ "test": "pnpm run /^test:/"
},