From c92765dd63456b1aadaa4a1608979326a8c6db9e Mon Sep 17 00:00:00 2001 From: DoctorLai Date: Tue, 21 Oct 2025 19:48:54 +0100 Subject: [PATCH] Add npm run coverage --- .github/workflows/coverage.yaml | 2 +- README.md | 2 +- package.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 7dfa701..d51bb95 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -26,7 +26,7 @@ jobs: run: npm ci - name: Run tests with coverage - run: npx vitest run --coverage + run: npm run coverage - name: Report coverage on PR uses: davelosert/vitest-coverage-report-action@v2 diff --git a/README.md b/README.md index 5a62b18..5ac1814 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ npm run test 5. Test coverage: ```bash -npx vitest run --coverage +npm run coverage ``` 6. Format code: diff --git a/package.json b/package.json index f4c1c00..8de4beb 100755 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "vite build", "preview": "vite preview", "test": "vitest --watch=false", + "coverage": "npx vitest run --coverage", "deploy": "npm run add-version && npm run build && gh-pages -d dist", "add-version": "echo \"VITE_COMMIT_HASH=$(git rev-parse --short HEAD)\" > .env", "format": "prettier --check 'src/**/*.{js,jsx}' 'tests/**/*.{js,jsx}'",