Like writing the acceptance criteria before starting construction — you know exactly what "done" means.
Write the test first. It will fail because ShoppingCart doesn't exist yet. The failing test defines the interface your code must satisfy.
> ✗ ShoppingCart starts empty > Cannot find module './cart' > 1 failed, 0 passed — Red phase ✓
Like writing the acceptance criteria before starting construction — you know exactly what "done" means.
Write the test first. It will fail because ShoppingCart doesn't exist yet. The failing test defines the interface your code must satisfy.
> ✗ ShoppingCart starts empty > Cannot find module './cart' > 1 failed, 0 passed — Red phase ✓
Sign in to cast your vote
Sign in to share your feedback and join the discussion.