mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added tests for jsdoc.parser.
This commit is contained in:
parent
f6f962e847
commit
1a6a90320e
@ -1,5 +1,6 @@
|
||||
load(BASEDIR + '/test/tests/01_jsdoc_opts.js');
|
||||
load(BASEDIR + '/test/tests/02_jsdoc_src.js');
|
||||
load(BASEDIR + '/test/tests/03_jsdoc_parser.js');
|
||||
|
||||
// see http://visionmedia.github.com/jspec/
|
||||
JSpec.run({
|
||||
|
||||
44
test/tests/03_jsdoc_parser.js
Normal file
44
test/tests/03_jsdoc_parser.js
Normal file
@ -0,0 +1,44 @@
|
||||
(function() {
|
||||
var jsdoc;
|
||||
|
||||
JSpec.describe('jsdoc/parser.js', function() {
|
||||
|
||||
before_each(function() {
|
||||
jsdoc = { parser: require('jsdoc/parser') };
|
||||
});
|
||||
|
||||
describe('The object exported by the jsdoc/src module', function() {
|
||||
it('should be an object', function() {
|
||||
expect(jsdoc.parser).to(be_an, Object);
|
||||
});
|
||||
|
||||
it('should have a `parseFiles` method', function() {
|
||||
expect(jsdoc.parser).to(respond_to, 'parseFiles');
|
||||
});
|
||||
});
|
||||
|
||||
describe('The jsdoc.parser.result value', function() {
|
||||
it('should initially be an empty array', function() {
|
||||
expect(jsdoc.parser.result).to(be_an, Array);
|
||||
expect(jsdoc.parser.result).to(have_length, 0);
|
||||
});
|
||||
|
||||
it('should be set by calling jsdoc.parser.parseFiles', function() {
|
||||
jsdoc.parser.parseFiles(BASEDIR + 'test/tests/03_jsdoc_parser.js');
|
||||
expect(jsdoc.parser.result).to(be_an, Array);
|
||||
expect(jsdoc.parser.result).to(have_length, 1);
|
||||
});
|
||||
|
||||
it('should be set 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');
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
(function testarea() {
|
||||
|
||||
/** @constructor Foo */
|
||||
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user