Skip to content

Commit

Permalink
test: Add specific test for quoted properties in type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Sep 14, 2017
1 parent 7fc6ca8 commit adf1bd0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions __tests__/lib/infer/type.js
Expand Up @@ -40,6 +40,28 @@ test('inferType', function() {
type: 'TypeApplication'
});

expect(evaluate('/** */' + "type V = {a:number,'b':string}").type).toEqual({
fields: [
{
key: 'a',
type: 'FieldType',
value: {
name: 'number',
type: 'NameExpression'
}
},
{
key: 'b',
type: 'FieldType',
value: {
name: 'string',
type: 'NameExpression'
}
}
],
type: 'RecordType'
});

expect(evaluate('/** */' + 'type V = Array<T>').type).toEqual({
applications: [
{
Expand Down

0 comments on commit adf1bd0

Please sign in to comment.