@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
18 lines (17 loc) • 840 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const difference_1 = require("./difference");
describe('difference', () => {
it('Should return an empty array if the provided array has no values', () => {
expect((0, difference_1.difference)([], [3, 2])).toEqual([]);
});
it('Should return an empty array if the provided values has no values', () => {
expect((0, difference_1.difference)([2, 1], [])).toEqual([]);
});
it('Should find the difference between two number arrays', () => {
expect((0, difference_1.difference)([2, 1], [3, 2])).toEqual([1]);
});
it('Should find the difference between two string arrays', () => {
expect((0, difference_1.difference)(['apple', 'banana', 'peach'], ['orange', 'apple'])).toEqual(['banana', 'peach']);
});
});