import "mocha"; import { expect } from "chai"; import { is } from "../helpers"; describe('Thunk factory "is.inArray"', () => { it("recognizes values, that exist in the list", () => { const list = [ 0, 1, 2, "text", { text:"text" }, [ "text" ] ]; const thunk = is.inArray(list); const valid = [ ...list ]; const invalid = list.map(value => ~value); for (const value of valid) expect(thunk(value)).to.be.true; for (const value of invalid) expect(thunk(value)).to.be.false; }); });