UNPKG

predictype

Version:

PredicType is a library of pre-built and tested predicates for TypeScript, covering various data types and operations.

23 lines (22 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const vitest_1 = require("vitest"); const bigintMembership_js_1 = require("./bigintMembership.js"); (0, vitest_1.describe)('bigintMembership', () => { (0, vitest_1.it)('should return true for in', () => { const value = BigInt(5); const arr = [BigInt(1), BigInt(2), BigInt(5)]; (0, vitest_1.expect)((0, bigintMembership_js_1.bigintMembership)(value, 'in', arr)).toBe(true); }); (0, vitest_1.it)('should return true for not_in', () => { const value = BigInt(3); const arr = [BigInt(1), BigInt(2), BigInt(5)]; (0, vitest_1.expect)((0, bigintMembership_js_1.bigintMembership)(value, 'not_in', arr)).toBe(true); }); (0, vitest_1.it)('should throw for unknown operator', () => { const value = BigInt(1); const arr = [BigInt(1), BigInt(2), BigInt(3)]; // @ts-expect-error (0, vitest_1.expect)(() => (0, bigintMembership_js_1.bigintMembership)(value, 'invalid_operator', arr)).toThrow('Unknown BigIntMembership operation: invalid_operator'); }); });