Skip to content

Commit 92e77e3

Browse files
committed
adding test for typedef github links
1 parent 18ae9e6 commit 92e77e3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

__tests__/lib/github.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,29 @@ test('enterprise repository', function() {
8585

8686
mock.restore();
8787
});
88+
89+
test('typedef', function() {
90+
mock(mockRepo.master);
91+
92+
expect(
93+
evaluate(function() {
94+
/**
95+
* A number, or a string containing a number.
96+
* @typedef {(number|string)} NumberLike
97+
*/
98+
99+
/**
100+
* get one
101+
* @returns {number} one
102+
*/
103+
function getOne() {
104+
return 1;
105+
}
106+
})[0].context.github
107+
).toEqual({
108+
path: 'index.js',
109+
url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L1-L4'
110+
});
111+
112+
mock.restore();
113+
});

0 commit comments

Comments
 (0)