File "toArray.test.ts"
Full path: /home/fsibplc/public_html/sommilito-bank2/splide-4.1.3/src/js/utils/array/toArray/toArray.test.ts
File
size: 464 B (464 B bytes)
MIME-type: text/x-java
Charset: utf-8
Download Open Edit Advanced Editor Back
import { toArray } from './toArray';
describe( 'toArray', () => {
test( 'can push a provided value into an array.', () => {
expect( toArray( 1 ) ).toEqual( [ 1 ] );
expect( toArray( true ) ).toEqual( [ true ] );
expect( toArray( { a: 1 } ) ).toStrictEqual( [ { a: 1 } ] );
} );
test( 'should return a provided value itself if it is already an array.', () => {
const array = [ 1 ];
expect( toArray( array ) ).toBe( array );
} );
} );