Skip to content

Commit d47721e

Browse files
committedFeb 18, 2024
fix(ci): add coverage support
1 parent 06ed27b commit d47721e

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed
 

‎.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci?schema=public
124124

125125
- name: Test
126-
run: pnpm test
126+
run: pnpm coverage
127127
env:
128128
POSTGRES_STORAGE_ENABLED: true
129129
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
"format": "prettier --write \"**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path .gitignore",
1818
"lint": "turbo lint && manypkg check",
1919
"lint:fix": "turbo lint:fix && manypkg fix",
20-
"test": "dotenv -e .env.test vitest",
21-
"test:ui": "vitest --ui",
20+
"test": "dotenv -e .env.test -- vitest",
21+
"coverage": "dotenv -e .env.test -- vitest --coverage",
22+
"test:ui": "dotenv -e .env.test -- vitest --ui",
2223
"test:setup": "turbo test:setup",
2324
"test:dev": "pnpm test:setup && pnpm test",
2425
"type-check": "turbo type-check",

‎scripts/run-integration.sh

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ echo '🟡 - Waiting for database to be ready...'
77
$DIR/wait-for-it.sh -t 5 "${DATABASE_URL}" -- echo '🟢 - Database is ready!'
88
echo '🟡 - Waiting for storage to be ready...'
99
$DIR/wait-for-it.sh -t 5 "${GOOGLE_STORAGE_API_ENDPOINT}" -- echo '🟢 - Storage is ready!'
10+
npx prisma migrate reset --force
1011
npx prisma migrate dev --skip-seed --name init --schema $DIR/../packages/db/prisma/schema.prisma

‎scripts/setenv.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
DIR="$(cd "$(dirname "$0")" && pwd)"
44

55
# Export env vars
6-
export $(grep -v '^#' $DIR/../.env | xargs)
6+
export $(grep -v '^#' $DIR/../.env.test | xargs)

‎vitest.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { defineConfig } from "vitest/config";
33
export default defineConfig({
44
test: {
55
coverage: {
6-
enabled: true,
7-
reporter: ["html"],
6+
reporter: ["text", "json", "html"],
87
},
98
onConsoleLog(log) {
109
if (log.includes("prisma:query")) return false;

0 commit comments

Comments
 (0)
Please sign in to comment.