Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
696 Bytes
import isFunction from '../../utils/isFunction';
describe('isFunction', () => {
it('should return true when value is a function', () => {
expect(isFunction(() => null)).toBeTruthy();
expect(
isFunction(function foo() {
return null;
}),
).toBeTruthy();
});
it('should return false when value is not a function', () => {
expect(isFunction(null)).toBeFalsy();
expect(isFunction(undefined)).toBeFalsy();
expect(isFunction(-1)).toBeFalsy();
expect(isFunction(0)).toBeFalsy();
expect(isFunction(1)).toBeFalsy();
expect(isFunction('')).toBeFalsy();
expect(isFunction({})).toBeFalsy();
expect(isFunction([])).toBeFalsy();
});
});