mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
@augments tests - add test that you can @augment multiple doclets
This commit is contained in:
parent
cd1fb6c96a
commit
e4c90b2fee
18
test/fixtures/augmentstag3.js
vendored
Normal file
18
test/fixtures/augmentstag3.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// test to see that we can @augment multiple things (code allows for it)
|
||||
/** @class */
|
||||
function Foo() {
|
||||
}
|
||||
/** A method. */
|
||||
Foo.prototype.method1 = function () {};
|
||||
|
||||
/** @class */
|
||||
function Bar() {
|
||||
}
|
||||
/** Another method. */
|
||||
Bar.prototype.method2 = function () {}
|
||||
|
||||
/** @class
|
||||
* @augments Foo
|
||||
* @augments Bar */
|
||||
function FooBar() {
|
||||
}
|
||||
@ -24,7 +24,13 @@
|
||||
bazMethod3 = docSet.getByLongname('Baz#method3')[0],
|
||||
|
||||
docSet2 = jasmine.getDocSetFromFile('test/fixtures/augmentstag2.js'),
|
||||
qux = docSet2.getByLongname('Qux')[0];
|
||||
qux = docSet2.getByLongname('Qux')[0],
|
||||
|
||||
docSet3 = jasmine.getDocSetFromFile('test/fixtures/augmentstag3.js'),
|
||||
FooMethod1 = docSet3.getByLongname('Foo#method1')[0],
|
||||
BarMethod2 = docSet3.getByLongname('Bar#method2')[0],
|
||||
FooBarMethod1 = docSet3.getByLongname('FooBar#method1')[0],
|
||||
FooBarMethod2 = docSet3.getByLongname('FooBar#method2')[0];
|
||||
|
||||
it('When a symbol has an @augments tag, the doclet has a augments property that includes that value.', function() {
|
||||
expect(typeof bar.augments).toBe('object');
|
||||
@ -82,4 +88,12 @@
|
||||
expect(typeof qux.augments).toBe('object');
|
||||
expect(qux.augments[0]).toBe('UndocumentedThing');
|
||||
});
|
||||
|
||||
|
||||
it('When a symbol @augments multiple parents, it inherits methods from all parents', function() {
|
||||
expect(FooBarMethod1).toBeDefined();
|
||||
expect(FooBarMethod2).toBeDefined();
|
||||
expect(FooBarMethod1.description).toBe(FooMethod1.description);
|
||||
expect(FooBarMethod2.description).toBe(BarMethod2.description);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user