pytest does a lot for you, and Node’s test runner does some of it differently. Port an eleven-test pytest suite as plain functions, so def test_out_of_stock(): becomes function test_out_of_stock() {, run it with node --test, and the report says tests 1 and pass 1. The run succeeds without checking anything.
In this course, you’ll port the pytest suite for a ski-hire shop’s fitting module, which already runs in JavaScript but has no tests yet.
By the end of this course, you’ll be able to:
- Write test files that
node --testfinds, and compare values and objects withnode:assert/strict - Check errors with
assert.throws(), and run one test over many cases - Share setup with
beforeEach(), and test async code withassert.rejects() - Replace a collaborator with
t.mock - Port the shop’s whole pytest suite to JavaScript
You’ll need pytest suites with plain assert, pytest.raises(), parametrize, fixtures, an async test, and monkeypatch. You’ll also need Node 26 and JavaScript modules with import and export, classes, your own error classes, and async functions with await. The Python examples use Python 3.15 with pytest and pytest-asyncio.
The course mixes short videos and text lessons with exercises, a project that ports the whole suite, and a quiz.
What’s Included:
- 17 Lessons
- Video Subtitles and Full Transcripts
- Translated Subtitles in 8 Languages
- 2 Downloadable Resources
- Interactive Quiz to Check Your Progress
- 5 Hands-On Coding Exercises
- Q&A With JavaScript Experts: Ask a Question
- Certificate of Completion
Downloadable Resources:
Related Learning Paths: