mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
add test codes for @interface, @implements annotations.
This commit is contained in:
parent
ef70ffe2bd
commit
52426cd3a7
@ -181,7 +181,7 @@ exports.addImplemented = function(docs) {
|
||||
});
|
||||
});
|
||||
|
||||
for (var key in implemented) {
|
||||
for (var key in implemented) { if (implemented.hasOwnProperty(key)) {
|
||||
// implemented classes namespace.
|
||||
var owner = implemented[key];
|
||||
|
||||
@ -204,6 +204,6 @@ exports.addImplemented = function(docs) {
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
};
|
||||
|
||||
@ -374,7 +374,8 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = {
|
||||
'namespace',
|
||||
'package',
|
||||
'param',
|
||||
'typedef'
|
||||
'typedef',
|
||||
'interface'
|
||||
]
|
||||
},
|
||||
license: {
|
||||
|
||||
12
test/fixtures/interface-implements.js
vendored
Normal file
12
test/fixtures/interface-implements.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/** @interface */
|
||||
function ITester() {}
|
||||
ITester.prototype.beforeEach = function() {};
|
||||
ITester.prototype.it = function() {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {ITester}
|
||||
*/
|
||||
function MyTester() {}
|
||||
MyTester.prototype.beforeEach = function() {};
|
||||
MyTester.prototype.it = function() {};
|
||||
18
test/specs/tags/implementstag.js
Normal file
18
test/specs/tags/implementstag.js
Normal file
@ -0,0 +1,18 @@
|
||||
xdescribe('interface-implements suite', function() {
|
||||
var docSet = jasmine.getDocSetFromFile("test/fixtures/interface-implements.js");
|
||||
|
||||
var foundMyTester = docSet.getByLongname('MyTester');
|
||||
var foundBeforeEachMethod = docSet.getByLongname('MyTester#beforeEach');
|
||||
|
||||
it('MyTester has "implements" array property', function() {
|
||||
expect(Array.isArray(foundMyTester[0].implements)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('beforeEach has "implemented" and "implements" property', function() {
|
||||
expect(foundBeforeEachMethod[0].implemented).toBeDefined();
|
||||
expect(foundBeforeEachMethod[0].implemented).toBeTruthy();
|
||||
expect(foundBeforeEachMethod[0].implements).toBeDefined();
|
||||
expect(Array.isArray(foundMyTester[0].implements)).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
||||
10
test/specs/tags/interfacetag.js
Normal file
10
test/specs/tags/interfacetag.js
Normal file
@ -0,0 +1,10 @@
|
||||
describe('@interface tag', function() {
|
||||
var docSet = jasmine.getDocSetFromFile("test/fixtures/interface-implements.js");
|
||||
|
||||
var foundInterface = docSet.getByLongname('ITester');
|
||||
|
||||
it('ITester has "interface" value in "kind"', function() {
|
||||
expect(foundInterface[0].kind).toEqual('interface');
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user