Files
teamchong ad7ef7c1ac docs(demo): cost-ab + effective-context A/B demos with a model arg
Both demos default to Fable; pass a model as the first arg (a.sh opus, sonnet,
haiku, or a full claude-... id) to override -- run both columns on the same
model for a fair A/B. Adds eval/ab token-savings scripts.
2026-06-17 10:01:33 -04:00
..

pricing-engine

A small order-pricing library. Computes an order total from line items, a volume discount, a loyalty-tier discount, and tax.

  • src/pricing.jsorderTotalCents(items, tier) (currently buggy — your task)
  • src/money.js — monetary helpers (roundHalfEven, formatCents)
  • src/catalog.js — product catalog + SKU → line-item resolution
  • SPEC.md — the exact pricing rules the implementation must follow
  • test/ — the test suite (node --test)

Task

src/pricing.js does not follow SPEC.md and the tests fail. Implement the rules in SPEC.md so that node --test passes (5 tests). No dependencies to install — Node's built-in test runner is used.

node --test