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

26 lines
974 B
JavaScript

describe('inline comments on function parameters', () => {
it('should not crash when multiple parameters have inline comments that do not contain any' +
'JSDoc tags', () => {
function loadDocSet() {
jasmine.getDocSetFromFile('test/fixtures/inlineparamcomment.js');
}
expect(loadDocSet).not.toThrow();
});
describe('ES 2015 only', () => {
const docSet = jasmine.getDocSetFromFile('test/fixtures/inlineparamcomment2.js');
const foo = docSet.getByLongname('ns.foo')[0];
it('should attach inline comments to default parameters', () => {
expect(foo.params[0].type.names.length).toBe(1);
expect(foo.params[0].type.names[0]).toBe('string');
});
it('should attach inline comments to rest parameters', () => {
expect(foo.params[1].type.names.length).toBe(1);
expect(foo.params[1].type.names[0]).toBe('number');
});
});
});