Lesson 28 of 55
javascriptTesting JavaScript – Unit & Integration
12 mins
Course progress51%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 28 of 55
javascript12 mins
Keep these ideas in mind as you work through the lesson.
Popular test frameworks:
// sum.js
export const sum = (a,b) => a + b;
// sum.test.js
import {sum} from './sum.js';
test('adds two numbers', () => {
expect(sum(1,2)).toBe(3);
});
npm test.describe('My App',()=>{
it('shows hello message',()=>{
cy.visit('/');
cy.contains('h1','Hello');
});
});