

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Running Tests
incomplete
2: Tests on CI
incomplete
3: Code Coverage
incomplete
4: README Badge for Tests
incomplete
This lesson's interactive features are locked, please to keep using them
Our current CI doesn't do anything interesting.
A good CI pipeline typically includes:
If any of the tests fail, the build is considered "broken" and the developer is notified (in our case by GitHub) so they can fix it.
The Notely repo has, gasp, zero unit tests! In this course we're going to use the vitest testing framework, it's very popular and easy to setup.
npm install -D vitest
"scripts": {
"test": "vitest --run"
},
import { describe, expect, test } from "vitest";
const person = {
isActive: true,
age: 32,
};
describe("person", () => {
test("person is defined", () => {
expect(person).toBeDefined();
});
test("is active", () => {
expect(person.isActive).toBeTruthy();
});
});
npm run test
Run and submit the CLI tests from the root of your repo.