Earn points from assessments, invites & promo — redeem mentor consult vouchers in the Points Plaza
← Virtual projects
Free Review to certify

Add Tests to Your Code (Node.js)

Write real unit tests with Node’s built-in test runner — prove your logic works.

Skills you'll learn
Unit testing Jest / test runners Mocks & assertions TDD intro Refactoring confidence

~90 min · +45 pts

Shipping features without tests is risky. Learn the minimum hiring teams expect. Starter: /assets/templates/js-testing-lab/ (pure functions + node:test) You will: 1) Implement status helpers for a job tracker / Kanban 2) Write failing tests first (or at least solid tests) 3) Run npm test and fix until green 4) Add 1 edge-case test (empty input, invalid status, etc.) Submit: repo or pasted test output + reflection (120+ chars).

Environment setup (start here)

Node 18+ includes built-in test runner — no Jest install needed.

Node.js required

Pick your OS and follow from step 1:

1) Node.js LTS (v18+)
2) Folder C:\Users\YourName\js-testing-lab with starter files
3) PowerShell: cd folder → npm install (may be empty) → npm test
4) Green output = passing tests.
1) Node 18+ → cd ~/Documents/js-testing-lab → npm test
How do I know it worked?

npm test exits with code 0 and shows passing assertions.

Common issues

Tests fail after edit → read the assertion message; fix status.js not the test first unless spec is wrong.

Starter pack

Write unit tests with Node’s built-in runner; get npm test green, then add one edge case.

README status.js status.test.js package.json

/assets/templates/js-testing-lab/ · npm test

Sign in to complete steps and earn an e-certificate.

Log in
CareerAck Assistant
Hi! I can help with career paths, assessments, interview prep, and jobs. Book mentors with points or a consult voucher. Ask anything.