jsdoc/test/specs/documentation/funcExpression.js
Jeff Williams aa0b6c1bfa switch to new-ish ECMAScript syntax
With help from Lebab, plus a lot of manual cleanup. (And more cleanup to come, I'm sure.)
2019-01-15 18:39:10 -08:00

29 lines
1.1 KiB
JavaScript

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