jsdoc/test/specs/documentation/funcExpression.js
Jeff Williams 5f578e803b migrate from old, vendored Jasmine to jasmine package (#1602)
Plus some miscellaneous cleanup.
2019-01-21 19:38:07 -08:00

30 lines
1.1 KiB
JavaScript

/* global jsdoc */
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(jsdoc.getDocSetFromFile('test/fixtures/funcExpression.js'));
});
describe('global', () => {
checkLongnames(jsdoc.getDocSetFromFile('test/fixtures/funcExpression2.js'));
});
describe('as object literal property', () => {
checkLongnames(jsdoc.getDocSetFromFile('test/fixtures/funcExpression3.js'), 'ns.');
});
});