Skip to content

Commit 07922c3

Browse files
committed
Add README with coverage/complexity/duplication badges
1 parent 84a9637 commit 07922c3

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# example-typescript
2+
3+
[![coverage badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fdemo.coveragetracker.dev%2Fapi%2Fbadge%2FCoverageTracker%2Fexample-typescript%2Fcoverage.json)](https://demo.coveragetracker.dev/CoverageTracker/example-typescript?metric=coverage)
4+
[![complexity badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fdemo.coveragetracker.dev%2Fapi%2Fbadge%2FCoverageTracker%2Fexample-typescript%2Fcomplexity.json)](https://demo.coveragetracker.dev/CoverageTracker/example-typescript?metric=complexity)
5+
[![duplication badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fdemo.coveragetracker.dev%2Fapi%2Fbadge%2FCoverageTracker%2Fexample-typescript%2Fduplication.json)](https://demo.coveragetracker.dev/CoverageTracker/example-typescript?metric=duplication)
6+
7+
A small, idiomatic TypeScript invoicing/cart library used as the JS/TS
8+
reference example for [Coverage Tracker](https://coveragetracker.dev). It
9+
exists to give the JS/TS row in the
10+
[coverage report generation guide](https://coveragetracker.dev/docs/generating-coverage-reports)
11+
a live, working reference, and to populate the
12+
[demo dashboard](https://demo.coveragetracker.dev) with real trend data.
13+
14+
**This is a demo/marketing repo, not a test suite for Coverage Tracker
15+
itself.**
16+
17+
## What's here
18+
19+
- `src/` — discount/cart calculations, currency formatting, and validation
20+
helpers, each with real branching logic.
21+
- `test/` — a [vitest](https://vitest.dev) suite with a deliberately
22+
uncovered branch or two, so `branch_coverage < line_coverage` shows up on
23+
the dashboard.
24+
- `.github/workflows/coverage.yml` — runs tests with coverage, generates a
25+
[Lizard](https://github.com/terryyin/lizard) complexity report and a
26+
[jscpd](https://github.com/kucherenko/jscpd) duplication report (a small
27+
duplicated block is seeded on purpose), then reports all three to the demo
28+
instance via the `coverage-tracker` reporting Action.
29+
30+
## Running locally
31+
32+
```sh
33+
npm ci
34+
npm run coverage # writes coverage/lcov.info
35+
```

0 commit comments

Comments
 (0)