-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement: adapted tests to the latest state.
- Loading branch information
Showing
39 changed files
with
733 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { Type, TypeArtisan, Property, Factory } from './../src'; | ||
import { ObjectFactory } from './../src/factories'; | ||
import { Factory, Property, Type, TypeArtisan } from '../src'; | ||
import { TypeFactory } from '../src/factories'; | ||
|
||
@Type() | ||
@Factory(new ObjectFactory()) | ||
@Factory(new TypeFactory()) | ||
class User | ||
{ | ||
@Property() @Factory(new ObjectFactory()) public name?: string; | ||
@Property() @Factory(new TypeFactory()) public name?: string; | ||
} | ||
|
||
describe('Type factory decorator', function () | ||
describe('Type factory decorator', () => | ||
{ | ||
it('should register custom factory for a type', function () | ||
it('should register custom factory for a type', () => | ||
{ | ||
const userMetadata = TypeArtisan.extractTypeMetadata(User); | ||
|
||
expect(userMetadata.typeOptions.factory).toBeInstanceOf(ObjectFactory); | ||
expect(userMetadata.typeOptions.factory).toBeInstanceOf(TypeFactory); | ||
}); | ||
|
||
it('should register custom factory for a property', function () | ||
it('should register custom factory for a property', () => | ||
{ | ||
const userMetadata = TypeArtisan.extractTypeMetadata(User); | ||
const userNameMetadata = userMetadata.propertyMetadataMap.get('name'); | ||
|
||
expect(userNameMetadata).toBeDefined(); | ||
expect(userNameMetadata?.propertyOptions.factory).toBeInstanceOf(ObjectFactory); | ||
expect(userNameMetadata?.propertyOptions.factory).toBeInstanceOf(TypeFactory); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
16 changes: 8 additions & 8 deletions
16
spec/naming-conventions/camel-case.naming-convention.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
spec/naming-conventions/flat-case.naming-convention.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
spec/naming-conventions/flat-upper-case.naming-convention.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.