Files
remark42/frontend/app/utils/is-object.spec.ts
T
Paul MineevandUmputun 9bae155e79 Fixes for telegram
- fix type for an error in fetcher
- use is-object func for checks
- better error handling for auth requests
2022-02-11 10:59:19 -06:00

29 lines
525 B
TypeScript

import { isObject } from './is-object';
describe('is-object', () => {
it.each`
input
${null}
${undefined}
${0}
${1}
${''}
${'string'}
${true}
${false}
${[]}
${[1, 2, 3]}
`('should return false if is NOT an object', ({ input }) => {
expect(isObject(input)).toBe(false);
});
it.each`
input
${{}}
${{ a: 1 }}
${{ a: 1, b: 2 }}
${new Error()}
`('should return true if IS an object', ({ input }) => {
expect(isObject(input)).toBe(true);
});
});