mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added tests for jsdoc/docset.
This commit is contained in:
parent
1a6a90320e
commit
794ce9831b
@ -1,6 +1,7 @@
|
||||
load(BASEDIR + '/test/tests/01_jsdoc_opts.js');
|
||||
load(BASEDIR + '/test/tests/02_jsdoc_src.js');
|
||||
load(BASEDIR + '/test/tests/03_jsdoc_parser.js');
|
||||
load(BASEDIR + '/test/tests/04_jsdoc_docset.js');
|
||||
|
||||
// see http://visionmedia.github.com/jspec/
|
||||
JSpec.run({
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
expect(jsdoc.parser.result).to(have_length, 1);
|
||||
});
|
||||
|
||||
it('should be set be populated by doclets', function() {
|
||||
it('should be populated by doclets', function() {
|
||||
jsdoc.parser.parseFiles(BASEDIR + 'test/tests/03_jsdoc_parser.js');
|
||||
expect(jsdoc.parser.result[0].constructor.name).to(eql, 'Doclet');
|
||||
});
|
||||
|
||||
40
test/tests/04_jsdoc_docset.js
Normal file
40
test/tests/04_jsdoc_docset.js
Normal file
@ -0,0 +1,40 @@
|
||||
(function() {
|
||||
var jsdoc;
|
||||
|
||||
JSpec.describe('jsdoc/docset.js', function() {
|
||||
|
||||
before_each(function() {
|
||||
// docsets can only be created by parsers
|
||||
jsdoc = { parser: require('jsdoc/parser') };
|
||||
jsdoc.parser.parseFiles(BASEDIR + 'test/tests/04_jsdoc_docset.js');
|
||||
});
|
||||
|
||||
describe('The docset object', function() {
|
||||
it('should be an array', function() {
|
||||
expect(jsdoc.parser.result).to(be_an, Array);
|
||||
});
|
||||
|
||||
it('should have a `toObject` method', function() {
|
||||
expect(jsdoc.parser.result).to(respond_to, 'toObject');
|
||||
});
|
||||
|
||||
it('should have a `toString` method', function() {
|
||||
expect(jsdoc.parser.result).to(respond_to, 'toString');
|
||||
});
|
||||
|
||||
it('should have a `toJSON` method', function() {
|
||||
expect(jsdoc.parser.result).to(respond_to, 'toJSON');
|
||||
});
|
||||
|
||||
it('should have a `toXML` method', function() {
|
||||
expect(jsdoc.parser.result).to(respond_to, 'toXML');
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
(function testarea() {
|
||||
|
||||
/** @constructor Foo */
|
||||
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user