File "includes.test.ts"

Full path: /home/fsibplc/public_html/sommilito-bank2/splide-4.1.3/src/js/utils/array/includes/includes.test.ts
File size: 505 B (505 B bytes)
MIME-type: text/x-java
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

import { includes } from './includes';


describe( 'includes', () => {
  const array = [ 1, 2, 3 ];

  test( 'can check if the array includes a certain value or not.', () => {
    expect( includes( array, 1 ) ).toBe( true );
    expect( includes( array, 2 ) ).toBe( true );
    expect( includes( array, 3 ) ).toBe( true );

    expect( includes( array, 5 ) ).toBe( false );
    expect( includes( array, 'a' as any ) ).toBe( false );
    expect( includes( array, true as any ) ).toBe( false );
  } );
} );