Files
30-seconds-of-code/test/zipWith.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

12 lines
444 B
JavaScript

const {zipWith} = require('./_30s.js');
test('zipWith is a Function', () => {
expect(zipWith).toBeInstanceOf(Function);
});
test('zipWith returns the correct results', () => {
expect(zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c)).toEqual([111, 222]);
});
test('zipWith returns the correct results if no function is passed', () => {
expect(zipWith([1, 2], [10, 20], [100, 200])).toEqual([[1, 10, 100], [2, 20, 200]]);
});