|
| 1 | +# example-typescript |
| 2 | + |
| 3 | +[](https://demo.coveragetracker.dev/CoverageTracker/example-typescript?metric=coverage) |
| 4 | +[](https://demo.coveragetracker.dev/CoverageTracker/example-typescript?metric=complexity) |
| 5 | +[](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