Skip to content

Instantly share code, notes, and snippets.

@a6kme
Created April 24, 2019 05:58
Show Gist options
  • Save a6kme/2a82990b39030ebae7b20d9fb455570a to your computer and use it in GitHub Desktop.
Save a6kme/2a82990b39030ebae7b20d9fb455570a to your computer and use it in GitHub Desktop.
Library code in test
// test/arithmetic/add.test.js
import { add } from '../../src';
test('Two integers should get added up', () => {
expect(add(2, 3)).toBe(5);
expect(add(-1, 0)).toBe(-1);
});
// test/range/max.test.js
import { max } from '../../src';
test('Should give max entry from a given array', () => {
expect(max([1, 3, 4])).toBe(4);
expect(max([1, 10, 10])).toBe(10);
expect(max([-1, -5, 0])).toBe(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment