/
githubmirror
/
immutable-js
Обзор
Документация
Войти
/
githubmirror
/
immutable-js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
__tests__/functional/has.ts
21 строка
702 B
Julien Deniau
sort all imports via eslint
12 июн 2025, 01:23
12 июн 2025, 01:23
67a4fa9
Код
Авторство
О чём код?
import { describe, expect, it } from '@jest/globals'; import { List, Map, Range, has } from 'immutable'; describe('has', () => { it('for immutable structure', () => { expect(has(Range(0, 100), 20)).toBe(true); expect(has(List(['dog', 'frog', 'cat']), 1)).toBe(true); expect(has(List(['dog', 'frog', 'cat']), 20)).toBe(false); expect(has(Map({ x: 123, y: 456 }), 'x')).toBe(true); }); it('for Array', () => { expect(has(['dog', 'frog', 'cat'], 1)).toBe(true); expect(has(['dog', 'frog', 'cat'], 20)).toBe(false); }); it('for plain objects', () => { expect(has({ x: 123, y: 456 }, 'x')).toBe(true); expect(has({ x: 123, y: 456 }, 'z')).toBe(false); }); });