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

29 lines
1.5 KiB
JavaScript

(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/var.js'),
found = [
docSet.getByLongname('GREEN'),
docSet.getByLongname('RED'),
docSet.getByLongname('validate'),
docSet.getByLongname('i'),
docSet.getByLongname('results')
];
test('When a series of constants are documented.', function() {
assert.equal(found[0].length, 1, 'The first constant should be found');
assert.equal(found[0][0].comment, '/** document me */', 'The first constant should get the docs.');
assert.equal(found[0][0].name, 'GREEN', 'The short name should be correct.');
assert.equal(found[0][0].memberof, undefined, 'The memberof should be undefined.');
assert.equal(found[0][0].scope, 'global', 'The scope should be global.');
assert.equal(found[1].length, 1, 'The second constant should be found');
assert.equal(found[1][0].undocumented, true, 'The second constant should not get the docs.');
});
test('When member of a series of vars are documented.', function() {
assert.equal(found[4][0].comment, '/** document me */', 'The correct var should get the docs.');
assert.equal(found[4][0].name, 'results', 'The short name should be correct.');
assert.equal(found[4][0].memberof, undefined, 'The memberof should be undefined.');
assert.equal(found[4][0].scope, 'global', 'The scope should be global.');
});
})();