Skip to content

Commit

Permalink
fix(ci): add coverage support
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGabi committed Feb 18, 2024
1 parent 06ed27b commit d47721e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci?schema=public

- name: Test
run: pnpm test
run: pnpm coverage
env:
POSTGRES_STORAGE_ENABLED: true
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"format": "prettier --write \"**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path .gitignore",
"lint": "turbo lint && manypkg check",
"lint:fix": "turbo lint:fix && manypkg fix",
"test": "dotenv -e .env.test vitest",
"test:ui": "vitest --ui",
"test": "dotenv -e .env.test -- vitest",
"coverage": "dotenv -e .env.test -- vitest --coverage",
"test:ui": "dotenv -e .env.test -- vitest --ui",
"test:setup": "turbo test:setup",
"test:dev": "pnpm test:setup && pnpm test",
"type-check": "turbo type-check",
Expand Down
1 change: 1 addition & 0 deletions scripts/run-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ echo '🟡 - Waiting for database to be ready...'
$DIR/wait-for-it.sh -t 5 "${DATABASE_URL}" -- echo '🟢 - Database is ready!'
echo '🟡 - Waiting for storage to be ready...'
$DIR/wait-for-it.sh -t 5 "${GOOGLE_STORAGE_API_ENDPOINT}" -- echo '🟢 - Storage is ready!'
npx prisma migrate reset --force
npx prisma migrate dev --skip-seed --name init --schema $DIR/../packages/db/prisma/schema.prisma
2 changes: 1 addition & 1 deletion scripts/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
DIR="$(cd "$(dirname "$0")" && pwd)"

# Export env vars
export $(grep -v '^#' $DIR/../.env | xargs)
export $(grep -v '^#' $DIR/../.env.test | xargs)
3 changes: 1 addition & 2 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
coverage: {
enabled: true,
reporter: ["html"],
reporter: ["text", "json", "html"],
},
onConsoleLog(log) {
if (log.includes("prisma:query")) return false;
Expand Down

0 comments on commit d47721e

Please sign in to comment.