Skip to content

Commit adf1bd0

Browse files
committed
test: Add specific test for quoted properties in type definitions
1 parent 7fc6ca8 commit adf1bd0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

__tests__/lib/infer/type.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ test('inferType', function() {
4040
type: 'TypeApplication'
4141
});
4242

43+
expect(evaluate('/** */' + "type V = {a:number,'b':string}").type).toEqual({
44+
fields: [
45+
{
46+
key: 'a',
47+
type: 'FieldType',
48+
value: {
49+
name: 'number',
50+
type: 'NameExpression'
51+
}
52+
},
53+
{
54+
key: 'b',
55+
type: 'FieldType',
56+
value: {
57+
name: 'string',
58+
type: 'NameExpression'
59+
}
60+
}
61+
],
62+
type: 'RecordType'
63+
});
64+
4365
expect(evaluate('/** */' + 'type V = Array<T>').type).toEqual({
4466
applications: [
4567
{

0 commit comments

Comments
 (0)