Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
sommilito-bank2
/
splide-4.1.3
/
src
/
js
/
utils
/
array
/
push
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
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 ); } ); } );