15 lines
372 B
JavaScript
15 lines
372 B
JavaScript
const expect = require('expect');
|
|
const median = require('./median.js');
|
|
|
|
|
|
test('median is a Function', () => {
|
|
expect(median).toBeInstanceOf(Function);
|
|
});
|
|
test('Returns the median of an array of numbers', () => {
|
|
expect(median([5, 6, 50, 1, -5])).toBe(5)
|
|
});
|
|
test('Returns the median of an array of numbers', () => {
|
|
expect(median([1, 2, 3])).toBe(2)
|
|
});
|
|
|