jsdoc/test/specs/documentation/funcExpression.js
Jeff Williams 44d9ec6831 new parser infrastructure
consumes ASTs that follow the Mozilla Parser API spec:
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API

passes all tests on OS X; performance is comparable to previous
version. also includes some miscellaneous cleanup.

remaining issues:
- only Rhino AST builder is supported
- node visitors (old and new) may not be hooked up yet
- circular-reference issues in doclets
- docs are (mostly) missing
- various other TODO comments
2013-06-23 10:18:13 -07:00

30 lines
1.2 KiB
JavaScript

/*global describe: true, expect: true, it: true, jasmine: true */
describe('function expressions', function() {
function checkLongnames(docSet, namespace) {
var memberName = (namespace || '') + 'Foo#member1';
var variableName = (namespace || '') + 'Foo~var1';
var fooMember = docSet.getByLongname(memberName)[0];
var fooVariable = docSet.getByLongname(variableName)[0];
it('should assign the correct longname to members of a function expression', function() {
expect(fooMember.longname).toBe(memberName);
});
it('should assign the correct longname to variables in a function expression', function() {
expect(fooVariable.longname).toBe(variableName);
});
}
describe('standard', function() {
checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression.js') );
});
describe('global', function() {
checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression2.js') );
});
describe('as object literal property', function() {
checkLongnames( jasmine.getDocSetFromFile('test/fixtures/funcExpression3.js'), 'ns.' );
});
});