Skip to content

Commit

Permalink
Added generic type test.
Browse files Browse the repository at this point in the history
  • Loading branch information
neogeek committed Sep 6, 2022
1 parent 8a32841 commit 08a8cc7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/dox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,4 +964,13 @@ module.exports = {
done();
});
},

'test generic types': function(done){
fixture('types.js', function(err, str){
var comments = dox.parseComments(str);
comments[0].tags[0].types[0].should.equal("Promise<string|null>");
comments[1].tags[0].types[0].should.equal("Promise.<string|null>");
done();
});
},
};
7 changes: 7 additions & 0 deletions test/fixtures/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @return {Promise<string | null>} Promise that returns a string if available.
*/

/**
* @return {Promise.<string | null>} Promise that returns a string if available.
*/

0 comments on commit 08a8cc7

Please sign in to comment.