mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
JSDoc-specific test functions are now properties of a `jsdoc` global, not a `jasmine` global. Also updates license files to reflect the fact that we no longer vendor anything.
26 lines
970 B
JavaScript
26 lines
970 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() {
|
|
jsdoc.getDocSetFromFile('test/fixtures/inlineparamcomment.js');
|
|
}
|
|
|
|
expect(loadDocSet).not.toThrow();
|
|
});
|
|
|
|
describe('ES 2015 only', () => {
|
|
const docSet = jsdoc.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');
|
|
});
|
|
});
|
|
});
|