mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
clean up fixtures; add some missing tests
This commit is contained in:
parent
e89ecd615f
commit
17c58d76e5
23
test/fixtures/jslangnames.js
vendored
23
test/fixtures/jslangnames.js
vendored
@ -1,23 +0,0 @@
|
|||||||
/** @namespace */
|
|
||||||
var constructor = {
|
|
||||||
/** document me */
|
|
||||||
toString: function(){}
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @namespace */
|
|
||||||
var prototype = {
|
|
||||||
/** document me */
|
|
||||||
valueOf: function(){}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is Object
|
|
||||||
* @namespace Object
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is Object.hasOwnProperty
|
|
||||||
* @method Object.hasOwnProperty
|
|
||||||
*/
|
|
||||||
|
|
||||||
// NOTE: you can't document a prototype of an object in JSDoc -- seriously, you just can't
|
|
||||||
14
test/fixtures/specialnames.js
vendored
14
test/fixtures/specialnames.js
vendored
@ -1,2 +1,14 @@
|
|||||||
|
/** @namespace */
|
||||||
|
var constructor = {
|
||||||
|
/** document me */
|
||||||
|
toString: function() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** @namespace */
|
||||||
|
var prototype = {
|
||||||
|
/** document me */
|
||||||
|
valueOf: function() {}
|
||||||
|
};
|
||||||
|
|
||||||
/** document me */
|
/** document me */
|
||||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
|||||||
@ -2,11 +2,31 @@
|
|||||||
|
|
||||||
describe('documenting symbols with special names', function() {
|
describe('documenting symbols with special names', function() {
|
||||||
var docSet = jasmine.getDocSetFromFile('test/fixtures/specialnames.js');
|
var docSet = jasmine.getDocSetFromFile('test/fixtures/specialnames.js');
|
||||||
var name = docSet.getByLongname('hasOwnProperty').filter(function($) {
|
var construct = docSet.getByLongname('constructor')[0];
|
||||||
return !($.undocumented);
|
var constructToString = docSet.getByLongname('constructor.toString')[0];
|
||||||
|
var hasOwnProp = docSet.getByLongname('hasOwnProperty')[0];
|
||||||
|
var proto = docSet.getByLongname('prototype')[0];
|
||||||
|
var protoValueOf = docSet.getByLongname('prototype.valueOf')[0];
|
||||||
|
|
||||||
|
it('When a symbol is named "constructor", the symbol should appear in the docs.', function() {
|
||||||
|
expect(construct).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('When a symbol is named "constructor", its members are resolved correctly.', function() {
|
||||||
|
expect(constructToString).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('When a symbol is named "hasOwnProperty," the symbol should appear in the docs.', function() {
|
it('When a symbol is named "hasOwnProperty," the symbol should appear in the docs.', function() {
|
||||||
expect(name.length).toEqual(1);
|
expect(hasOwnProp).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
// currently broken: https://github.com/jsdoc3/jsdoc/issues/891
|
||||||
|
xit('When a symbol is named "prototype", the symbol should appear in the docs.', function() {
|
||||||
|
expect(proto).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
// currently broken: https://github.com/jsdoc3/jsdoc/issues/891
|
||||||
|
xit('When a symbol is named "prototype", its members are resolved correctly.', function() {
|
||||||
|
expect(protoValueOf).toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user