Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,28 @@ jobs:
fi
items=()
[[ "$ADMIN" == "true" ]] && items+=(
'{"service":"admin","lint_command":"pnpm admin lint","build_command":"pnpm admin build","app_command":"pnpm admin build:app","app_dotenv":".env.prod","spec_command":"pnpm admin test"}'
'{"service":"admin","lint_command":"pnpm admin lint","build_command":"pnpm admin build","app_command":"pnpm admin build:app","app_dotenv":".env.prod","spec_command":"pnpm admin test:coverage"}'
)
[[ "$AGENT" == "true" ]] && items+=(
'{"service":"agent","lint_command":"pnpm agent lint","build_command":"pnpm agent build","spec_command":"pnpm agent test"}'
'{"service":"agent","lint_command":"pnpm agent lint","build_command":"pnpm agent build","spec_command":"pnpm agent test:coverage"}'
)
[[ "$AI_BOT" == "true" ]] && items+=(
'{"service":"ai-bot","lint_command":"pnpm ai-bot lint","build_command":"pnpm ai-bot build","spec_command":"pnpm ai-bot test"}'
)
[[ "$API" == "true" ]] && items+=(
'{"service":"api","lint_command":"pnpm api lint","build_command":"pnpm api build","spec_command":"pnpm api test:spec","e2e_command":"pnpm api test:e2e","migration_command":"pnpm api migration:run","dotenv_path":"./.env.test","needs_db":true}'
'{"service":"api","lint_command":"pnpm api lint","build_command":"pnpm api build","spec_command":"pnpm api test:coverage","e2e_command":"pnpm api test:e2e","migration_command":"pnpm api migration:run","dotenv_path":"./.env.test","needs_db":true}'
)
[[ "$PACKAGES" == "true" ]] && items+=(
'{"service":"packages","lint_command":"pnpm packages lint","spec_command":"pnpm packages test"}'
'{"service":"packages","lint_command":"pnpm packages lint","spec_command":"pnpm packages test:coverage"}'
)
[[ "$STORYBOOK" == "true" ]] && items+=(
'{"service":"storybook","lint_command":"pnpm storybook lint","build_command":"pnpm storybook typecheck","app_command":"pnpm storybook build:app","app_dotenv":".env.prod","spec_command":"pnpm storybook test"}'
)
[[ "$WEB" == "true" ]] && items+=(
'{"service":"web","lint_command":"pnpm web lint","build_command":"pnpm web build","app_command":"pnpm web build:app-server","app_dotenv":".env.prod","spec_command":"pnpm web test"}'
'{"service":"web","lint_command":"pnpm web lint","build_command":"pnpm web build","app_command":"pnpm web build:app-server","app_dotenv":".env.prod","spec_command":"pnpm web test:coverage"}'
)
[[ "$WORKER" == "true" ]] && items+=(
'{"service":"worker","lint_command":"pnpm worker lint","build_command":"pnpm worker build","spec_command":"pnpm worker test","e2e_command":"pnpm worker test:e2e","dotenv_path":"./.env.test","needs_db":true}'
'{"service":"worker","lint_command":"pnpm worker lint","build_command":"pnpm worker build","spec_command":"pnpm worker test:coverage","e2e_command":"pnpm worker test:e2e","dotenv_path":"./.env.test","needs_db":true}'
)
joined=$(IFS=,; echo "${items[*]}")
echo "matrix={\"include\":[$joined]}" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions packages/@liexp/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "vitest",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand Down
7 changes: 4 additions & 3 deletions packages/@liexp/backend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export default extendBaseConfig(import.meta.url, (toAlias) => ({
include: ["src/**/*.ts"],
exclude: ["src/test"],
thresholds: {
lines: 50,
statements: 50,
functions: 50,
lines: 80,
statements: 80,
branches: 80,
functions: 80,
},
},
},
Expand Down
4 changes: 3 additions & 1 deletion packages/@liexp/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "echo 'No tests configured for @liexp/core'",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand All @@ -37,7 +38,8 @@
"eslint-plugin-import-x": "^4.16.2",
"fp-ts": "^2.16.10",
"typescript": "^5.9.3",
"vite-plugin-svgr": "^4.3.0"
"vite-plugin-svgr": "^4.3.0",
"vitest": "^4.1.2"
},
"peerDependencies": {
"debug": "*",
Expand Down
19 changes: 19 additions & 0 deletions packages/@liexp/core/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
name: "@liexp/core",
globals: true,
include: ["src/**/*.spec.ts"],
watch: false,
coverage: {
include: ["src/**/*.ts"],
thresholds: {
lines: 80,
statements: 80,
branches: 80,
functions: 80,
},
},
},
});
1 change: 1 addition & 0 deletions packages/@liexp/io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "vitest",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand Down
2 changes: 2 additions & 0 deletions packages/@liexp/io/vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default defineConfig({
coverage: {
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
alias: {
Expand Down
1 change: 1 addition & 0 deletions packages/@liexp/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "vitest",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand Down
6 changes: 4 additions & 2 deletions packages/@liexp/shared/vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default defineConfig({
watch: false,
coverage: {
thresholds: {
statements: 80,
functions: 80,
statements: 60,
branches: 55,
functions: 55,
lines: 60,
},
},
alias: {
Expand Down
4 changes: 3 additions & 1 deletion packages/@liexp/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "echo 'No tests configured for @liexp/test'",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand All @@ -30,7 +31,8 @@
"effect": "^3.20.0",
"eslint": "^10.1.0",
"fp-ts": "^2.16.10",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "^4.1.2"
},
"peerDependencies": {
"effect": "^3",
Expand Down
19 changes: 19 additions & 0 deletions packages/@liexp/test/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
name: "@liexp/test",
globals: true,
include: ["src/**/*.spec.ts"],
watch: false,
coverage: {
include: ["src/**/*.ts"],
thresholds: {
lines: 80,
statements: 80,
branches: 80,
functions: 80,
},
},
},
});
1 change: 1 addition & 0 deletions packages/@liexp/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"clean": "rm -rf lib",
"lint": "eslint --cache src",
"test": "vitest",
"test:coverage": "vitest --run --coverage",
"watch": "tsc -b -w"
},
"lint-staged": {
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/admin/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
projects: ["./vitest.config.*.ts"],
projects: ["./vitest.config.e2e.ts", "./vitest.config.spec.ts"],
reporters: ["verbose"],
watch: false,
coverage: {
Expand Down
6 changes: 6 additions & 0 deletions services/agent/vitest.config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default extendBaseConfig(import.meta.url, (toAlias) => ({
coverage: {
include: ["src/**/*.ts"],
exclude: ["src/**/*.e2e.ts", "test"],
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
},
}));
1 change: 1 addition & 0 deletions services/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"start:worker": "node build/worker/index.js",
"test": "pnpm vitest",
"test:all": "pnpm test:spec --run && pnpm test:e2e --run",
"test:coverage": "vitest --run --coverage --project api-spec",
"test:e2e": "vitest --project api-e2e",
"test:spec": "vitest --project api-spec",
"tsx:build": "tsx --tsconfig tsconfig.build.json",
Expand Down
3 changes: 3 additions & 0 deletions services/api/vitest.config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export default extendBaseConfig(import.meta.url, (toAlias) => ({
coverage: {
include: ["src/**/*.ts"],
exclude: ["src/**/*.e2e.ts", "test"],
// TODO: add coverage thresholds once the service can run tests without a
// live database. Currently most tests require a DB connection and are
// exercised via e2e rather than unit tests.
}
},
}));
1 change: 1 addition & 0 deletions services/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"scripts:make-avatars-mock": "tsx ./scripts/make-avatars-mock.ts",
"serve": "node ./build/server/server.js",
"test": "vitest",
"test:coverage": "vitest --run --coverage --project=web-spec",
"test:e2e": "vitest --project=web-e2e",
"test:spec": "vitest --project=web-spec",
"watch": "tsc -b --watch",
Expand Down
13 changes: 13 additions & 0 deletions services/web/vitest.config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,18 @@ export default defineProject({
include: ["src/**/*.spec.ts", "src/**/*.test.ts"],
exclude: ["node_modules/**", "build/**", "**/*.e2e.ts"],
root: __dirname,
coverage: {
include: ["src/**/*.ts", "src/**/*.tsx"],
exclude: ["src/**/*.e2e.ts", "node_modules/**", "build/**"],
// The only existing spec is a static code-inspection test (fs.readFileSync).
// No source paths are instrumented, so coverage stays at 0%.
// TODO: add real unit tests and raise thresholds to 80%.
thresholds: {
statements: 0,
branches: 0,
functions: 0,
lines: 0,
},
},
},
});
1 change: 1 addition & 0 deletions services/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"bin:upsert-nlp-entities": "node ./build/bin/cli.js upsert-nlp-entities",
"start": "node build/run.js",
"test": "vitest",
"test:coverage": "vitest --run --coverage",
"test:e2e": "vitest --project worker-e2e",
"tsx:build": "tsx --tsconfig tsconfig.build.json",
"watch": "tsc -b ./tsconfig.build.json --watch",
Expand Down
2 changes: 2 additions & 0 deletions services/worker/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default extendBaseConfig(import.meta.url, (toAlias) => ({
coverage: {
include: ["src/**/*.ts"],
exclude: ["test/**/*.e2e.ts", "test"],
// TODO: add coverage thresholds once the service can run tests without a
// live database. Worker tests are all e2e and require a running DB.
},
},
poolOptions: {
Expand Down
Loading