@splidejs/splide
Version:
Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.
20 lines (15 loc) • 580 B
text/typescript
import { push } from './push';
describe( 'push', () => {
test( 'can push an item to an array.', () => {
expect( push( [], 1 ) ).toEqual( [ 1 ] );
expect( push( [ 1 ], 2 ) ).toEqual( [ 1, 2 ] );
} );
test( 'can push items to an array.', () => {
expect( push( [], [ 1, 2, 3 ] ) ).toEqual( [ 1, 2, 3 ] );
expect( push( [ 1, 2, 3 ], [ 4, 5, 6 ] ) ).toEqual( [ 1, 2, 3, 4, 5, 6 ] );
} );
test( 'should return the provided array itself.', () => {
const array: number[] = [];
expect( push( array, 1 ) ).toBe( array );
} );
} );