inlineparamcomment.js 1010 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. describe('inline comments on function parameters', function() {
  3. it('should not crash when multiple parameters have inline comments that do not contain any' +
  4. 'JSDoc tags', function() {
  5. function loadDocSet() {
  6. jasmine.getDocSetFromFile('test/fixtures/inlineparamcomment.js');
  7. }
  8. expect(loadDocSet).not.toThrow();
  9. });
  10. describe('ES 2015 only', function() {
  11. var docSet = jasmine.getDocSetFromFile('test/fixtures/inlineparamcomment2.js');
  12. var foo = docSet.getByLongname('ns.foo')[0];
  13. it('should attach inline comments to default parameters', function() {
  14. expect(foo.params[0].type.names.length).toBe(1);
  15. expect(foo.params[0].type.names[0]).toBe('string');
  16. });
  17. it('should attach inline comments to rest parameters', function() {
  18. expect(foo.params[1].type.names.length).toBe(1);
  19. expect(foo.params[1].type.names[0]).toBe('number');
  20. });
  21. });
  22. });