Skip to content

Commit 25c016b

Browse files
committed
tests: isValueOf
1 parent 128311f commit 25c016b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/n4s/src/rules/__tests__/isValueOf.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ describe('isValueOf tests', () => {
4747
expect(() => enforce(null).isValueOf(testObject)).toThrow();
4848
});
4949
});
50+
51+
describe('When object to check is nullish', () => {
52+
it('Should return false', () => {
53+
expect(isValueOf('Bravo', null)).toBe(false);
54+
expect(isValueOf('Bravo', undefined)).toBe(false);
55+
});
56+
});
5057
});
5158

5259
describe('isNotValueOf tests', () => {
@@ -69,4 +76,11 @@ describe('isNotValueOf tests', () => {
6976
expect(() => enforce(42).isNotValueOf(testObject)).toThrow();
7077
});
7178
});
79+
80+
describe('When object to check is nullish', () => {
81+
it('Should return true', () => {
82+
expect(isNotValueOf('Bravo', null)).toBe(true);
83+
expect(isNotValueOf('Bravo', undefined)).toBe(true);
84+
});
85+
});
7286
});

0 commit comments

Comments
 (0)