@@ -59,7 +59,7 @@ describe('VirtualsFactory', () => {
5959 } ;
6060
6161 beforeEach ( ( ) => {
62- ( schemaMock . virtual as any ) = jest . fn ( ( ) => ( {
62+ schemaMock . virtual = jest . fn ( ( ) => ( {
6363 get : setVirtualGetterFunctionMock ,
6464 set : setVirtualSetterFunctionMock ,
6565 } ) ) ;
@@ -70,23 +70,23 @@ describe('VirtualsFactory', () => {
7070 } ) ;
7171
7272 describe ( 'Schema virtual definition' , ( ) => {
73- it ( 'should not define virtuals if there is no stored virtual definition ' , ( ) => {
73+ it ( 'should not define any virtuals if no virtual definitions are stored ' , ( ) => {
7474 TypeMetadataStorage [ 'virtuals' ] = [ ] ;
7575
7676 VirtualsFactory . inspect ( targetConstructorMock , schemaMock ) ;
7777
78- expect ( schemaMock . virtual ) . toHaveBeenCalledTimes ( 0 ) ;
78+ expect ( schemaMock . virtual ) . not . toHaveBeenCalled ( ) ;
7979 } ) ;
8080
81- it ( 'should not define virtuals if there is no stored virtual definition linked to schema model' , ( ) => {
81+ it ( 'should not define virtuals if there are no stored virtual definitions linked to the schema model' , ( ) => {
8282 TypeMetadataStorage [ 'virtuals' ] = [ virtualMetadataNotLikedToModelMock ] ;
8383
8484 VirtualsFactory . inspect ( targetConstructorMock , schemaMock ) ;
8585
86- expect ( schemaMock . virtual ) . toHaveBeenCalledTimes ( 0 ) ;
86+ expect ( schemaMock . virtual ) . not . toHaveBeenCalled ( ) ;
8787 } ) ;
8888
89- it ( 'should defines virtual for each stored virtualMetadata linked to schema model' , ( ) => {
89+ it ( 'should define virtuals for each stored virtual metadata linked to the schema model' , ( ) => {
9090 TypeMetadataStorage [ 'virtuals' ] = [
9191 virtualMetadataWithOnlyRequiredAttributesMock ,
9292 virtualMetadataNotLikedToModelMock ,
@@ -105,19 +105,19 @@ describe('VirtualsFactory', () => {
105105 } ) ;
106106 } ) ;
107107
108- describe ( 'Schema virtual getter/setter definition ' , ( ) => {
109- it ( 'should not call the getter/setter definition method if no getter/setter defined in the stored virtual metadata linked to the schema model' , ( ) => {
108+ describe ( 'Schema virtual getter/setter definitions ' , ( ) => {
109+ it ( 'should not call the getter/setter methods if no getter/setter is defined in the stored virtual metadata linked to the schema model' , ( ) => {
110110 TypeMetadataStorage [ 'virtuals' ] = [
111111 virtualMetadataWithOptionsMock ,
112112 ] as VirtualMetadataInterface [ ] ;
113113
114114 VirtualsFactory . inspect ( targetConstructorMock , schemaMock ) ;
115115
116- expect ( setVirtualGetterFunctionMock ) . toHaveBeenCalledTimes ( 0 ) ;
117- expect ( setVirtualSetterFunctionMock ) . toHaveBeenCalledTimes ( 0 ) ;
116+ expect ( setVirtualGetterFunctionMock ) . not . toHaveBeenCalled ( ) ;
117+ expect ( setVirtualSetterFunctionMock ) . not . toHaveBeenCalled ( ) ;
118118 } ) ;
119119
120- it ( 'should call the getter/setter definition method for each stored virtuals metadata with defined getter/setter linked to the schema model' , ( ) => {
120+ it ( 'should invoke the getter/setter methods for each stored virtual metadata with defined getter/setter linked to the schema model' , ( ) => {
121121 TypeMetadataStorage [ 'virtuals' ] = [
122122 virtualMetadataWithOptionsMock ,
123123 virtualMetadataWithGetterMock ,
0 commit comments