index.test.js 363 B

12345678910111213
  1. const { add, greet } = require('../src/index');
  2. describe('Utility functions', () => {
  3. test('add should sum two numbers', () => {
  4. expect(add(2, 3)).toBe(5);
  5. expect(add(-1, 1)).toBe(0);
  6. });
  7. test('greet should return a greeting', () => {
  8. expect(greet('World')).toBe('Hello, World!');
  9. expect(greet('Marius')).toBe('Hello, Marius!');
  10. });
  11. });