Skip to content

Commit 03df725

Browse files
committed
Add tests for StringLiteral and NumberLiteral types
1 parent f14fff4 commit 03df725

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/lib/flow_doctrine.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ test('flowDoctrine', function (t) {
112112
name: 'undefined'
113113
}, 'undefined');
114114

115+
t.deepEqual(flowDoctrine(toComment(
116+
"/** add */function add(a: \"value\") { }"
117+
).context.ast.value.params[0].typeAnnotation.typeAnnotation),
118+
{
119+
type: 'StringLiteral',
120+
name: 'value'
121+
}, 'StringLiteral');
122+
123+
t.deepEqual(flowDoctrine(toComment(
124+
"/** add */function add(a: 1) { }"
125+
).context.ast.value.params[0].typeAnnotation.typeAnnotation),
126+
{
127+
type: 'NumberLiteral',
128+
name: '1'
129+
}, 'NumberLiteral');
130+
115131
t.end();
116132
});
117133
/* eslint-enable */

0 commit comments

Comments
 (0)