jsdoc/test/specs/documentation/namedFuncStatement.js
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

41 lines
1.9 KiB
JavaScript

(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/namedFuncStatement.js'),
fooMember = docSet.getByLongname('Foo#member1')[0],
fooVariable = docSet.getByLongname('Foo~var1')[0];
//console.log(docSet);
test('A symbol that is a member of a named function statement.', function() {
assert.equal(fooMember.longname, 'Foo#member1', 'is documented as a member of the assigned name.');
});
test('A symbol that is a variable of a named function statement.', function() {
assert.equal(fooVariable.longname, 'Foo~var1', 'is documented as a variable of the assigned name.');
});
})();
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/namedFuncStatement2.js'),
fooMember = docSet.getByLongname('Foo#member1')[0],
fooVariable = docSet.getByLongname('Foo~var1')[0];
//console.log(docSet);
test('A symbol that is a member of a named function statement.', function() {
assert.equal(fooMember.longname, 'Foo#member1', 'is documented as a member of the assigned name.');
});
test('A symbol that is a variable of a named function statement.', function() {
assert.equal(fooVariable.longname, 'Foo~var1', 'is documented as a variable of the assigned name.');
});
})();
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/namedFuncStatement3.js'),
fooMember = docSet.getByLongname('ns.Foo#member1')[0],
fooVariable = docSet.getByLongname('ns.Foo~var1')[0];
//console.log(docSet);
test('A symbol that is a member of a named function statement.', function() {
assert.equal(fooMember.longname, 'ns.Foo#member1', 'is documented as a member of the assigned name.');
});
test('A symbol that is a variable of a named function statement.', function() {
assert.equal(fooVariable.longname, 'ns.Foo~var1', 'is documented as a variable of the assigned name.');
});
})();