ts-prime
Version:
A utility library for JavaScript and Typescript.
20 lines (19 loc) • 682 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var splitAt_1 = require("./splitAt");
describe('data_first', function () {
test('split', function () {
expect(splitAt_1.splitAt([1, 2, 3], 1)).toEqual([[1], [2, 3]]);
});
test('split at -1', function () {
expect(splitAt_1.splitAt([1, 2, 3, 4, 5], -1)).toEqual([[1, 2, 3, 4], [5]]);
});
});
describe('data_last', function () {
test('split', function () {
expect(splitAt_1.splitAt(1)([1, 2, 3])).toEqual([[1], [2, 3]]);
});
test('split at -1', function () {
expect(splitAt_1.splitAt(-1)([1, 2, 3, 4, 5])).toEqual([[1, 2, 3, 4], [5]]);
});
});