blob: 51b6c811e2d30c316c443148c17e7259030adbd2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { isObject, isTagged } from '../lib/index';
describe('types/tagged + types/object', () => {
test('isObject excludes null/arrays', () => {
expect(isObject({})).toBe(true);
expect(isObject([])).toBe(false);
expect(isObject(null)).toBe(false);
expect(isObject('x')).toBe(false);
});
test('isTagged checks _tag field', () => {
expect(isTagged({ _tag: 'X' }, 'X')).toBe(true);
expect(isTagged({ _tag: 'Y' }, 'X')).toBe(false);
expect(isTagged({}, 'X')).toBe(false);
});
});
|