You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No testing framework present — blocks adding automated tests #25
The project currently has no testing framework or test suite. package.json defines only compile, watch, and vscode:prepublish scripts, there's no test runner in devDependencies, and there are no test files anywhere in the repo.
This makes it impossible to add automated tests alongside bug fixes and features, which is standard best practice — regressions (like a stale status-bar value, or pricing/aggregation miscalculations) currently can only be caught by manual F5 debugging in the Extension Development Host.
Why it matters
Much of the logic is pure and highly testable in isolation: cost/pricing calculation (pricing.ts), data aggregation (daily/weekly/monthly/all-time in dataLoader.ts), quota-window handling (statusBar.ts), and i18n formatting (i18n.ts).
Without tests, every change risks silent regressions and reviewers have no automated signal.
A test suite would also enable CI to gate PRs.
Proposal
Add a lightweight test setup with minimal new dependencies. A couple of viable options:
Node's built-in test runner (node:test + node:assert) — zero new dependencies, run compiled output via node --test out/test/. Best for the pure logic modules that don't import the vscode API.
@vscode/test-electron + Mocha — the official VS Code extension testing approach, needed for anything that touches the live vscode API.
A pragmatic split is to extract pure logic into dependency-free modules and cover those with node:test, reserving the heavier electron-based harness for genuinely vscode-coupled code. Adding a test npm script and a CI workflow to run it on PRs would round it out.
Happy to open a PR setting this up if it'd be welcome.
This is a very welcome direction, @nickearnshaw — thank you for the detailed analysis and concrete proposal, and also for your continued, high-quality contributions. Really appreciate it!
I like the direction you're proposing. Between the two options, I'd lean toward the first one: Node's built‑in node:test runner against compiled output. Keeping zero new runtime dependencies is a big plus for maintainability.
If you'd still like to open the PR, that would be very welcome. A quick heads‑up: I'm quite busy right now and won't be able to review until next week. When I do, I plan to run some AI‑assisted checks on the test suite — if everything looks good, I'll merge it directly for v2.0.2.
Thanks again for your thoughtful analysis and consistent contributions. Looking forward to seeing the project get a solid test foundation! 🙌
Thanks @Carl723000, no worries on the timing, I'm going to be back at work this week after a break, so not sure when I will get the chance either. Will raise a PR when I do.
Activity
Carl723000 commentedon Jun 8, 2026
This is a very welcome direction, @nickearnshaw — thank you for the detailed analysis and concrete proposal, and also for your continued, high-quality contributions. Really appreciate it!
I like the direction you're proposing. Between the two options, I'd lean toward the first one: Node's built‑in
node:testrunner against compiled output. Keeping zero new runtime dependencies is a big plus for maintainability.If you'd still like to open the PR, that would be very welcome. A quick heads‑up: I'm quite busy right now and won't be able to review until next week. When I do, I plan to run some AI‑assisted checks on the test suite — if everything looks good, I'll merge it directly for v2.0.2.
Thanks again for your thoughtful analysis and consistent contributions. Looking forward to seeing the project get a solid test foundation! 🙌
nickearnshaw commentedon Jun 8, 2026
Thanks @Carl723000, no worries on the timing, I'm going to be back at work this week after a break, so not sure when I will get the chance either. Will raise a PR when I do.
v2.0.2: Fable 5 pricing, attribution & quota fixes, cost-composition …
Carl723000 commentedon Jun 11, 2026
Just a heads-up that v2.0.2 has landed with a fair few changes. It might be worth branching your test PR off the fresh main. Looking forward to it!
docs: update CLAUDE.md test status and note the flat src/test layout
test: add node:test framework with a seed pricing test (#25) (#32)
docs: document test expectations (CONTRIBUTING + CLAUDE.md) (#35)
docs: refresh README/Credits for the org move and the 2.1 final state