UNPKG

@ryusei/light

Version:

<div align="center"> <a href="https://light.ryuseijs.com"> <img alt="RyuseiLight" src="https://light.ryuseijs.com/images/svg/logo.svg" width="70"> </a>

26 lines (20 loc) 584 B
import { MapEntry } from '../types'; import { get } from './get'; describe( 'get', () => { test( 'can get an entry by a key.', () => { const map: MapEntry<string>[] = [ [ 'comment', '' ], [ 'keyword', '' ], [ 'string', '' ], ]; expect( get( map, 'keyword' ) ).toEqual( [ 'keyword', '' ] ); } ); test( 'should return undefined if no entry is found.', () => { const map: MapEntry<string>[] = [ [ 'comment', '' ], [ 'keyword', '' ], [ 'string', '' ], ]; expect( get( map, 'operator' ) ).toBeUndefined(); } ); } );