Skip to content

Commit 3059f0b

Browse files
committed
Add tests fir membership infering for methods
1 parent 5a504a2 commit 3059f0b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

__tests__/lib/infer/membership.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,38 @@ test('inferMembership - explicit', function() {
276276
scope: 'instance'
277277
});
278278

279+
expect(
280+
pick(
281+
evaluate(function() {
282+
/** @memberof bar */
283+
class Foo {
284+
/** */
285+
baz() {}
286+
}
287+
})[1], // [0] is an description for class Foo
288+
['memberof', 'scope']
289+
)
290+
).toEqual({
291+
memberof: 'bar.Foo',
292+
scope: 'instance'
293+
});
294+
295+
expect(
296+
pick(
297+
evaluate(function() {
298+
/** @memberof bar */
299+
class Foo {
300+
/** */
301+
static baz() {}
302+
}
303+
})[1], // [0] is an description for class Foo
304+
['memberof', 'scope']
305+
)
306+
).toEqual({
307+
memberof: 'bar.Foo',
308+
scope: 'static'
309+
});
310+
279311
expect(
280312
pick(
281313
evaluate(function() {

0 commit comments

Comments
 (0)