import "mocha"; import { expect } from "chai"; import { is } from "../helpers"; describe('Thunk factory "is.iterable"', () => { it('recognizes values, that have "Symbol.iterator" method', () => { const thunk = is.iterable(); const valid = [ "text", [], new Set() ]; const invalid = [ 5, {} ]; for (const value of valid) expect(thunk(value)).to.be.true; for (const value of invalid) expect(thunk(value)).to.be.false; }); });