UNPKG

msw

Version:

Seamless REST/GraphQL API mocking library for browser and Node.js.

24 lines (20 loc) 411 B
import { isIterable } from './isIterable' test('returns true given an iterator', () => { expect( isIterable( (function* () { yield 2 })(), ), ).toEqual(true) }) test('returns false given a regular function', () => { expect( isIterable( (function () { return null })(), ), ).toEqual(false) expect(isIterable((() => null)())).toEqual(false) })