1 import isFunction from './isFunction';
3 it('should return true for class', () => {
4 const result = isFunction(class Any {});
5 expect(result).toEqual(true);
8 it('should return true for function', () => {
9 const result = isFunction(() => {});
10 expect(result).toEqual(true);
13 it('should return true for generator ', () => {
14 const result = isFunction(function* () {}); // eslint-disable-line @typescript-eslint/no-empty-function
15 expect(result).toEqual(true);
18 it('should return false for non-functions', () => {
19 expect(isFunction([1, 2, 3])).toEqual(false);
20 expect(isFunction({ a: 1, b: 2, c: 3 })).toEqual(false);
21 expect(isFunction(true)).toEqual(false);