Skip to content

Commit 290fc09

Browse files
authored
test: Improve coverage of infer/kind, remove unused filterAccess line (#776)
1 parent c055aec commit 290fc09

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

__tests__/lib/infer/kind.js

+18
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ test('inferKind', function() {
5858
).kind
5959
).toBe('function');
6060

61+
expect(
62+
inferKind(toComment('/** Exported interface */' + 'interface myinter {}'))
63+
.kind
64+
).toBe('interface');
65+
66+
expect(
67+
inferKind(
68+
toComment(
69+
'/** Exported interface */' + 'module.exports.foo = function() {}'
70+
)
71+
).kind
72+
).toBe('function');
73+
74+
expect(
75+
inferKind(toComment('class A { /** Exported interface */' + 'foo: 1 }'))
76+
.kind
77+
).toBe('member');
78+
6179
expect(
6280
inferKind(
6381
toComment('/** Exported function */' + 'export function foo() {}')

src/filter_access.js

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import { walk } from './walk';
1212
* @return {Array<Object>} filtered comments
1313
*/
1414
function filterAccess(levels: Array<string>, comments: Array<Comment>) {
15-
levels = levels || ['public', 'undefined', 'protected'];
16-
1715
function filter(comment) {
1816
return (
1917
comment.kind === 'note' ||

0 commit comments

Comments
 (0)