Technology conceptsJavaScriptTestingJestOn this pageJest Getting Started Install npm install --save-dev jest Build test sum.jsexport function sum(a, b) { return a + b;} sum.test.jsimport { sum } from "./sum.js";test("adds 1 + 2 to equal 3", () => { expect(sum(1, 2)).toBe(3);}); Add Script package.json{ "scripts": { "test": "jest" }} References Offical Docs Usage API