unit-testing
Installation
SKILL.md
Unit Testing
Conventions
- Co-locate tests:
foo.test.tsnext tofoo.ts - Always wrap in
describenamed after the unit under test - Use
test, notit - Test behavior through public interfaces, not implementation details
- Good tests survive refactors — if the public API doesn't change, tests shouldn't break
describe("createCart", () => {
test("calculates total for multiple items", () => { ... });
test("returns empty items for new cart", () => { ... });
});