PROGRAMMING · DEVOPS · CI

Jest CI

Continuous integration for a JavaScript project: every change pushed to main runs the tests automatically with GitHub Actions.

Historial de ejecuciones del workflow Jest CI en GitHub ActionsJEST CI · 12 / 14
Program
Computer Programmer · DevOps Tools and Practices course, Lambton College
Year
2024
Role
Developer
Tools
Jest · GitHub Actions · Node.js 16

// 01 · THE MISSION

The mission

Manual testing takes time and lets bugs slip through. In this project I set up continuous integration for a JavaScript application: whenever a change lands on the main branch, GitHub Actions prepares a server, installs the project and runs the Jest tests with no human intervention. The repository history reflects the real process: the first attempts failed, I identified the cause, fixed it, and since then every change is validated automatically. Developed within the Computer Programmer program at Lambton College in Ontario, Canada, following professional standards for development, documentation and version control.

// WHAT WAS BUILT

The pipeline

  • Runs on every push to main
  • Ubuntu server with Node.js 16
  • Installs dependencies and grants Jest permissions
  • Runs the tests and confirms when everything passes

Documentation

  • A step-by-step README to replicate the setup
  • Screenshots of the workflow and the console
  • Improvement proposals: more tests and notifications

// CHALLENGES AND SOLUTIONS

Tests failed on GitHub but not locally

Jest's executable had no execute permission on the GitHub Actions server. I added a step that grants it (chmod +x) before running the tests, and the workflow turned green.

// TESTS

The same tests, locally and in the cloud

powershell
$ npm test

> [email protected] test
> jest

 PASS  __tests__/example.test.js
   ✓ adds 1 + 2 to equal 3 (4 ms)
   ✓ subtracts 5 - 2 to equal 3 (1 ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total

MISSION ACCOMPLISHED

Results and impact

Is your team still testing every change by hand?

I automate tests and deployments so your team saves time and ships with more confidence.