Skip to content

Commit 3e52ba5

Browse files
committed
chore(tests): codecov integration
- https://codecov.io Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 635587f commit 3e52ba5

File tree

3 files changed

+102
-1
lines changed

3 files changed

+102
-1
lines changed

.codecov.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# CODECOV CONFIGURATION
2+
# https://docs.codecov.com/docs/codecovyml-reference
3+
4+
---
5+
codecov:
6+
notify:
7+
after_n_builds: 4
8+
wait_for_ci: true
9+
require_ci_to_pass: true
10+
11+
comment:
12+
after_n_builds: 4
13+
behavior: default
14+
layout: header,diff,flags,tree,footer
15+
require_base: false
16+
require_changes: false
17+
require_head: true
18+
show_carryforward_flags: true
19+
show_critical_paths: true
20+
21+
coverage:
22+
precision: 2
23+
range: 90..100
24+
round: nearest
25+
status:
26+
changes:
27+
default:
28+
branches:
29+
- dependabot/*
30+
- feat/*
31+
- hotfix/*
32+
- main
33+
- release/*
34+
if_ci_failed: error
35+
if_not_found: success
36+
informational: false
37+
only_pulls: false
38+
patch:
39+
default:
40+
branches:
41+
- dependabot/*
42+
- feat/*
43+
- hotfix/*
44+
- main
45+
- release/*
46+
if_ci_failed: error
47+
if_not_found: success
48+
informational: false
49+
only_pulls: false
50+
target: 100%
51+
threshold: 0%
52+
project:
53+
default:
54+
branches:
55+
- dependabot/*
56+
- feat/*
57+
- hotfix/*
58+
- main
59+
- release/*
60+
if_ci_failed: error
61+
if_not_found: success
62+
informational: false
63+
only_pulls: false
64+
target: 100%
65+
threshold: 0%
66+
67+
flags:
68+
node19:
69+
carryforward: false
70+
paths:
71+
- src/
72+
node18:
73+
carryforward: false
74+
paths:
75+
- src/
76+
node16:
77+
carryforward: false
78+
paths:
79+
- src/
80+
node14:
81+
carryforward: false
82+
paths:
83+
- src/
84+
85+
github_checks:
86+
annotations: true
87+
88+
ignore:
89+
- '**/__mocks__/**'
90+
- '**/__tests__/**'
91+
- '**/index.ts'
92+
- src/interfaces/
93+
- src/types/
94+
95+
profiling:
96+
critical_files_paths:
97+
- src/*.ts

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# errnode
22

33
[![npm](https://img.shields.io/npm/v/@flex-development/errnode.svg)](https://npmjs.com/package/@flex-development/errnode)
4+
[![codecov](https://codecov.io/gh/flex-development/errnode/branch/main/graph/badge.svg?token=e2gnycTeI9)](https://codecov.io/gh/flex-development/errnode)
45
[![license](https://img.shields.io/github/license/flex-development/errnode.svg)](LICENSE.md)
56
[![conventional commits](https://img.shields.io/badge/-conventional%20commits-fe5196?logo=conventional-commits&logoColor=ffffff)](https://conventionalcommits.org/)
67
[![typescript](https://img.shields.io/badge/-typescript-3178c6?logo=typescript&logoColor=ffffff)](https://typescriptlang.org/)

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
"clean:modules": "trash ./.yarn/{cache,*.gz} ./node_modules",
4545
"clean:pack": "trash ./*.tgz",
4646
"clean:test": "yarn clean:coverage && trash ./__tests__/report.json",
47+
"codecov": "yarn test:cov && yarn test:cov:upload",
48+
"codecov:validate": "cat .codecov.yml | curl --data-binary @- https://codecov.io/validate",
4749
"conventional-changelog": "node --loader=./loader.mjs ./node_modules/.bin/conventional-changelog -n ./changelog.config.cts",
4850
"fix:cg": "yarn fix:format && yarn fix:lint",
4951
"fix:dedupe": "yarn dedupe --strategy=highest",
@@ -58,7 +60,8 @@
5860
"release": "bash ./scripts/release.sh",
5961
"test": "vitest run",
6062
"test:cov": "yarn clean:coverage; yarn test --coverage",
61-
"test:cov:serve": "serve ./coverage/lcov-report",
63+
"test:cov:serve": "serve -l 5432 ./coverage/lcov-report",
64+
"test:cov:upload": "./codecov -t $CODECOV_TOKEN -f ./coverage/lcov.info",
6265
"test:watch": "vitest",
6366
"typecheck": "vitest typecheck --run",
6467
"typecheck:watch": "vitest typecheck"

0 commit comments

Comments
 (0)