We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Tests on CI

Now that you've got some unit tests working locally, let's get them running on CI.

Assignment

- name: Install dependencies
  run: npm ci

Now that we need vitest to run our tests, we need the CI runner to install our dependencies. You're familiar with npm install, npm ci is very similar but stands for "clean-install", and is helpful in automated environments so we can be sure we get a clean install every time.

Very convenient that "ci" doesn't stand for anything else that might lead to confusion...

run: npm run test

You'd be surprised how many times companies I've worked at thought they had CI that was checking for failures, but broken code didn't actually fail the CI. It's important to make sure that your CI is checking for failures.

Paste the URL of your GitHub repo into the box and run the GitHub checks.