1 import isTruthy from './isTruthy';
3 describe('isTruthy()', () => {
4 it('tells whether a value is JavaScript "truthy" or not', () => {
5 expect(isTruthy(false)).toBe(false);
6 expect(isTruthy(null)).toBe(false);
7 expect(isTruthy(0)).toBe(false);
8 expect(isTruthy(undefined)).toBe(false);
10 expect(isTruthy([])).toBe(true);
11 expect(isTruthy({})).toBe(true);
12 expect(isTruthy(true)).toBe(true);
13 expect(isTruthy(1)).toBe(true);
14 expect(isTruthy(-1)).toBe(true);