Skip to content

Commit d40d013

Browse files
test(guardObjectKey): fix test cause of new function in check
1 parent d020961 commit d40d013

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/type/src/guard/test/guard-object-key.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// Function.
22
import { guardObjectKey } from '../lib/guard-object-key.func';
33
// Variables.
4-
import { CLASS } from './variables/class.const';
4+
import { CLASS, TEST_CLASS, TestClass } from './variables/class.const';
55
import { NUMBER } from './variables/number.const';
66
import { OBJECT_ONE } from './variables/object.const';
77
import { SYMBOL_NUMBER, SYMBOL_STRING } from './variables/symbol.const';
8-
import { TRUE } from './variables/boolean.const';
8+
import { TRUE, FALSE } from './variables/boolean.const';
99

1010
describe(guardObjectKey.name , () => {
1111
// Defined.
1212
it('is DEFINED', () => expect(guardObjectKey).toBeDefined());
1313

1414
// Checks ...
1515
describe(`checks`, () => {
16-
// it('callback', () => {
17-
// guardObjectKey(CLASS, ['firstName', 'surname'], (result: boolean, value: Class) => {
18-
// expect(result).toBe(TRUE);
19-
// expect(value).toEqual(CLASS);
20-
// return result;
21-
// });
22-
// });
16+
it('callback', () => {
17+
guardObjectKey<TestClass>(TEST_CLASS, ['firstName', 'surname'], (result: boolean, value: TestClass) => {
18+
expect(result).toBe(TRUE);
19+
expect(value).toEqual(CLASS);
20+
return result;
21+
});
22+
});
2323

2424
// ... instance.
2525
describe(`instance`, () => {
@@ -30,15 +30,15 @@ describe(guardObjectKey.name , () => {
3030
expect(guardObjectKey(CLASS, 5)).toBe(TRUE);
3131
});
3232

33-
it('finds getter number', () => expect(guardObjectKey(CLASS, NUMBER)).toBe(TRUE));
33+
it('finds getter number', () => expect(guardObjectKey(CLASS, NUMBER)).toBe(FALSE));
3434

3535
// string.
3636
it('has string key', () => expect(guardObjectKey(CLASS, 'surname')).toBe(TRUE));
3737

3838
// symbol.
3939
it('finds getter symbol key', () => {
40-
expect(guardObjectKey(CLASS, SYMBOL_NUMBER)).toBe(TRUE);
41-
expect(guardObjectKey(CLASS, SYMBOL_STRING)).toBe(TRUE);
40+
expect(guardObjectKey(CLASS, SYMBOL_NUMBER)).toBe(FALSE);
41+
expect(guardObjectKey(CLASS, SYMBOL_STRING)).toBe(FALSE);
4242
});
4343
});
4444
});

0 commit comments

Comments
 (0)