11// Function.
22import { guardInstance } from '../lib/guard-instance.func' ;
3- // Variables .
4- import { CLASS , Class } from '../../testing/variables/strict/class.const' ;
3+ // Constant .
4+ import { CLASS , Class , Persons } from '../../testing/variables/strict/class.const' ;
55import { FALSE_EXPECTATION , TRUE_EXPECTATION } from '../../testing/variables/strict/boolean.const' ;
66import { NUMBER } from '../../testing/variables/strict/number.const' ;
77import { NUMBER_INSTANCE , NUMBER_NEW_INSTANCE } from '../../testing/variables/strict/number.const' ;
88import { STRING } from '../../testing/variables/strict/string.const' ;
99import { STRING_INSTANCE , STRING_NEW_INSTANCE } from '../../testing/variables/strict/string.const' ;
1010import { TRUE , TRUE_INSTANCE , FALSE_INSTANCE , FALSE } from '../../testing/variables/strict/boolean.const' ;
11-
11+ import { personFunctionConstructor } from '../../testing/variables/strict/function.const' ;
12+ // Interface.
13+ import { Person } from '../../testing/interface/person.interface' ;
14+ /**
15+ * Tests.
16+ */
1217describe ( guardInstance . name , ( ) => {
18+ const personInstance : Person = new ( personFunctionConstructor as any ) ( 'First name' , 'Sur name' , 27 ) ;
19+ const personsInstance : Persons = new Persons ( ) ;
1320 // Defined.
1421 it ( 'is DEFINED' , ( ) => expect ( guardInstance ) . toBeDefined ( ) ) ;
1522
@@ -23,7 +30,11 @@ describe(guardInstance.name , () => {
2330 } ) ;
2431 } ) ;
2532 // ... instance.
26- describe ( `instance` , ( ) => it ( `CLASS` , ( ) => expect ( guardInstance ( CLASS , Class ) ) . toBe ( TRUE ) ) ) ;
33+ describe ( `instance` , ( ) => {
34+ it ( `CLASS` , ( ) => expect ( guardInstance ( CLASS , Class ) ) . toBe ( TRUE ) ) ;
35+ it ( `class Persons` , ( ) => expect ( guardInstance ( personsInstance , Persons ) ) . toBe ( TRUE ) ) ;
36+ it ( `function` , ( ) => expect ( guardInstance ( personInstance , personFunctionConstructor as any ) ) . toBe ( TRUE ) ) ;
37+ } ) ;
2738
2839 // ... primitives.
2940 describe ( `primitive` , ( ) => {
0 commit comments