Jannon 2d73440b3d Testing Framework Upgrade Part I
This first part of the testing framework upgrade:

- enhances the jsdoc script to allow switching to debug mode from the command line
- uses Jasmine to run tests
- adds flexibility to run tests from multiple root directories
- does automatic test discovery, so test files can just be created, dropped in an appropriate folder, and run without having to explicity add it to the test runner
- cleans up the test directory layout
- incorporates env.rhino.js which should make it easier to test templates
- is incomplete: this is just a savepoint.  About 1/3 of the tests have been converted.  The rest are still run through the old testrunner
2012-04-30 17:39:50 -07:00

22 lines
889 B
JavaScript

describe("module names", function() {
var parser = require('jsdoc/src/parser'),
srcParser = null, doclets;
beforeEach(function() {
env.opts._ = [__dirname + '/test/cases/modules/'];
srcParser = new parser.Parser();
require('jsdoc/src/handlers').attachTo(srcParser);
});
it("should create a name from the file path when no documented module name exists", function() {
doclets = srcParser.parse(__dirname + '/test/cases/modules/data/mod-1.js');
assert.ok(doclets.length > 1);
assert.equal(doclets[0].longname, 'module:data/mod-1');
});
it("should use the documented module name if available", function() {
doclets = srcParser.parse(__dirname + '/test/cases/modules/data/mod-2.js');
assert.ok(doclets.length > 1);
assert.equal(doclets[0].longname, 'module:my/module/name');
});
});