Skip to content

Commit

Permalink
Create test for object type in field
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Jul 7, 2020
1 parent 62a8b74 commit 9bc449f
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/type-compiler/snapshot/with-object-type-in-field/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Type } from 'recife';

@Type()
class User {
name?: String;
exist?: Boolean;
emails: String[];
params?: {
a: string;
b: string;
};
}

export default User;
64 changes: 64 additions & 0 deletions test/type-compiler/snapshot/with-object-type-in-field/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
'use-strict';

module.exports = {
types: [
{
fields: [
{
visible: true,
parentName: 'UserParams',
name: 'a',
isRequired: true,
type: 'String'
},
{
visible: true,
parentName: 'UserParams',
name: 'b',
isRequired: true,
type: 'String'
}
],
options: {},
name: 'UserParams',
nameModel: 'UserParams',
isExportDefaultModel: false
},
{
fields: [
{
visible: true,
parentName: 'User',
name: 'name',
isRequired: false,
type: 'String'
},
{
visible: true,
parentName: 'User',
name: 'exist',
isRequired: false,
type: 'Boolean'
},
{
visible: true,
parentName: 'User',
name: 'emails',
isRequired: true,
type: '[String]'
},
{
visible: true,
parentName: 'User',
name: 'params',
isRequired: false,
type: 'UserParams'
}
],
options: {},
name: 'User',
nameModel: 'User',
isExportDefaultModel: true
}
]
};

0 comments on commit 9bc449f

Please sign in to comment.