fix: github links for @typedef comments should link to comment, not c… · documentationjs/documentation@37a91b2

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,10 @@ function evaluate(fn) {

2525

);

2626

}

2727
28+

afterEach(function() {

29+

mock.restore();

30+

});

31+
2832

test('github', function() {

2933

mock(mockRepo.master);

3034

@@ -42,8 +46,6 @@ test('github', function() {

4246

path: 'index.js',

4347

url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8'

4448

});

45-
46-

mock.restore();

4749

});

4850
4951

test('malformed repository', function() {

@@ -60,8 +62,6 @@ test('malformed repository', function() {

6062

}

6163

})[0].context.github

6264

).toBe(undefined);

63-
64-

mock.restore();

6565

});

6666
6767

test('enterprise repository', function() {

@@ -82,6 +82,28 @@ test('enterprise repository', function() {

8282

url:

8383

'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8'

8484

});

85+

});

8586
86-

mock.restore();

87+

test('typedef', function() {

88+

mock(mockRepo.master);

89+
90+

expect(

91+

evaluate(function() {

92+

/**

93+

* A number, or a string containing a number.

94+

* @typedef {(number|string)} NumberLike

95+

*/

96+
97+

/**

98+

* get one

99+

* @returns {number} one

100+

*/

101+

function getOne() {

102+

return 1;

103+

}

104+

})[0].context.github

105+

).toEqual({

106+

path: 'index.js',

107+

url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L2-L5'

108+

});

87109

});