Files
30-seconds-of-code/test/percentile.test.js
Christian C. Salvadó 83a6a6ea32 [ENHANCEMENT] Properly configure eslint to work with jest (#988)
* chore: make aware eslint that we use jest

By setting up the jest environment, we no longer need to declare the
'test' global in the configuration.

* chore: don't need to import expect, it's a jest environment global

* chore: don't need to import expect when creating undefined test
2019-06-18 08:34:45 +03:00

9 lines
338 B
JavaScript

const {percentile} = require('./_30s.js');
test('percentile is a Function', () => {
expect(percentile).toBeInstanceOf(Function);
});
test('Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.', () => {
expect(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6)).toBe(55);
});