Skip to content

chore: ⬆️ bump package to match next release, test cov reporter #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 19, 2025
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Build action
run: npm run build

- name: Run tests with coverage
run: npm test

Expand Down
270 changes: 266 additions & 4 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@glideapps/vitest-v8-json-coverage-summary",
"version": "0.0.0-beta",
"version": "0.0.0-echo",
"description": "A plugin for vitest that generates a coverage summary in json format",
"type": "module",
"main": "index.js",
Expand Down Expand Up @@ -59,5 +59,8 @@
"@vitest/coverage-v8": "^3.2.4",
"typescript": "^5.0.0",
"vitest": "^3.2.4"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.6.1"
}
}
4 changes: 3 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ async function run(): Promise<void> {
// Read coverage file
const coverageFilePath = path.resolve(coverageFile);
if (!fs.existsSync(coverageFilePath)) {
core.setFailed(`Coverage file not found: ${coverageFilePath}`);
core.setFailed(
`coverage-summary.json file not found at path ${coverageFilePath}. Did you forget to add the reporter in your vitest.config.js?`
);
return;
}

Expand Down
9 changes: 9 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ export default defineConfig({
provider: "v8",
reporter: ["text", "json"],
reportsDirectory: "./coverage",
clean: true,
include: ["test-src/**/*", "src/v8.json.summary.reporter.ts"],
exclude: [
"src/action.ts",
"action.ts",
"**/*.d.ts",
"dist/**",
"node_modules/**",
],
},
reporters: ["default", new V8JSONSummaryReporter()],
},
Expand Down