mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
With help from Lebab, plus a lot of manual cleanup. (And more cleanup to come, I'm sure.)
29 lines
1.1 KiB
JavaScript
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.' );
|
|
});
|
|
});
|