ts-prime
Version:
A utility library for JavaScript and Typescript.
17 lines (16 loc) • 517 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var splitWhen_1 = require("./splitWhen");
it('should split array', function () {
expect(splitWhen_1.splitWhen([1, 2, 3, 1, 2, 3], function (x) { return x === 2; })).toEqual([
[1],
[2, 3, 1, 2, 3],
]);
});
it('should with no matches', function () {
var n = 1232;
expect(splitWhen_1.splitWhen([1, 2, 3, 1, 2, 3], function (x) { return x === n; })).toEqual([
[1, 2, 3, 1, 2, 3],
[],
]);
});