UNPKG

msw

Version:

The industry standard for API mocking in JavaScript.

24 lines (20 loc) • 412 B
import { isIterable } from './is-iterable' 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) })