Merge branch 'fix-typo-drive' into 'main'
[ProtonMail-WebClient.git] / packages / utils / isTruthy.test.ts
blob88d379b39f87c9def21da253a80ceb8bd3c99133
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);
15     });
16 });