Skip to content

Commit 08a8cc7

Browse files
committed
Added generic type test.
1 parent 8a32841 commit 08a8cc7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

test/dox.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -964,4 +964,13 @@ module.exports = {
964964
done();
965965
});
966966
},
967+
968+
'test generic types': function(done){
969+
fixture('types.js', function(err, str){
970+
var comments = dox.parseComments(str);
971+
comments[0].tags[0].types[0].should.equal("Promise<string|null>");
972+
comments[1].tags[0].types[0].should.equal("Promise.<string|null>");
973+
done();
974+
});
975+
},
967976
};

test/fixtures/types.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @return {Promise<string | null>} Promise that returns a string if available.
3+
*/
4+
5+
/**
6+
* @return {Promise.<string | null>} Promise that returns a string if available.
7+
*/

0 commit comments

Comments
 (0)