Skip to main content
Module

x/rambda/isFunction.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { isFunction } from './isFunction'
test('when function', () => { const fn = () => {}
expect(isFunction(fn)).toEqual(true)})
test('when promise', () => { const fn = Promise.resolve(2)
expect(isFunction(fn)).toBeFalse()})
test('when async', () => { const fn = async x => x
expect(isFunction(fn)).toEqual(true)})
test('when false', () => { expect(isFunction(null)).toEqual(false)})