Skip to content

test: improve test coverage for plugin-coverage #1055

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import coveragePlugin from '@code-pushup/coverage-plugin';

export default {
plugins: [
await coveragePlugin({
reports: ['coverage/lcov.info'],
}),
],
categories: [
{
slug: 'code-coverage',
title: 'Code coverage',
refs: [
{
type: 'group',
plugin: 'coverage',
slug: 'coverage',
weight: 1,
},
],
},
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
TN:
SF:src/utils.ts
FN:1,add
FN:5,subtract
FN:9,multiply
FN:13,divide
FNF:4
FNH:4
FNDA:1,add
FNDA:5,subtract
FNDA:9,multiply
FNDA:13,divide
DA:1,1
DA:2,1
DA:3,1
DA:4,1
DA:5,1
DA:6,1
DA:7,1
DA:8,1
DA:9,1
DA:10,1
DA:11,1
DA:12,1
DA:13,1
DA:14,1
DA:15,1
DA:16,1
DA:17,1
DA:18,1
DA:19,1
DA:20,1
LF:20
LH:20
BRF:2
BRH:2
BRDA:13,0,0,1
BRDA:13,1,0,1
end_of_record
11 changes: 11 additions & 0 deletions e2e/plugin-coverage-e2e/mocks/fixtures/nx-workspace/nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "nx/presets/npm.json",
"targets": {
"test": {
"executor": "@nx/vite:test",
"options": {
"configFile": "vitest.config.ts"
}
}
}
}
10 changes: 10 additions & 0 deletions e2e/plugin-coverage-e2e/mocks/fixtures/nx-workspace/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "test-nx-workspace",
"version": "1.0.0",
"scripts": {
"build": "echo \"build\""
},
"devDependencies": {
"nx": "^17.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
coverage: {
reporter: ['text', 'lcov'],
reportsDirectory: 'coverage',
},
},
});
Loading
Loading