jsdoc/test/specs/documentation/restparams.js
Jeff Williams 96c8f6994d handle ES 2015 rest parameters (#555)
As part of this commit, we automatically flag rest parameters as repeatable, even if the JSDoc comment doesn't identify the parameter as repeatable. As a result, it's difficult to document a rest parameter as though it were a normal parameter (should you want to do that for some reason). I may revert this piece if it generates complaints.
2015-02-27 14:39:20 -08:00

22 lines
772 B
JavaScript

'use strict';
describe('rest parameters', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/restparams.js');
var setAdmins = docSet.getByLongname('setAdmins')[0];
var setWidgetAccess = docSet.getByLongname('setWidgetAccess')[0];
it('should automatically mark standalone rest parameters as repeatable', function() {
var restParam = setAdmins.params[0];
expect(restParam.name).toBe('users');
expect(restParam.variable).toBe(true);
});
it('should automatically mark rest parameters as repeatable when they are mixed with other params', function() {
var restParam = setWidgetAccess.params[1];
expect(restParam.name).toBe('users');
expect(restParam.variable).toBe(true);
});
});