ts-prime
Version:
A utility library for JavaScript and Typescript.
17 lines (16 loc) • 496 B
JavaScript
import { takeWhile } from './takeWhile';
import { pipe } from './pipe';
describe('data_first', function () {
it('takeWhile', function () {
expect(takeWhile([1, 2, 3, 4, 3, 2, 1], function (x) { return x !== 4; })).toEqual([
1,
2,
3,
]);
});
});
describe('data_last', function () {
it('takeWhile', function () {
expect(pipe([1, 2, 3, 4, 3, 2, 1], takeWhile(function (x) { return x !== 4; }))).toEqual([1, 2, 3]);
});
});