Files
30-seconds-of-code/test/pullBy.test.js
2018-10-19 20:18:00 +03:00

12 lines
349 B
JavaScript

const expect = require('expect');
const {pullBy} = require('./_30s.js');
test('pullBy is a Function', () => {
expect(pullBy).toBeInstanceOf(Function);
});
var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }];
pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x);
test('Pulls the specified values', () => {
expect(myArray).toEqual([{ x: 2 }]);
});