Skip to content

Commit 9e37ebe

Browse files
committed
test(ngdoc): add test for @ngdoc function
1 parent 345c01c commit 9e37ebe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/spec/ngdocSpec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,26 @@ describe('ngdoc', function(){
496496
});
497497

498498

499+
describe('function', function(){
500+
it('should format', function(){
501+
var doc = new Doc({
502+
ngdoc:'function',
503+
name:'some.name',
504+
param: [
505+
{name:'a', optional: true},
506+
{name:'b', type: 'someType', optional: true, 'default': '"xxx"'},
507+
{name:'c', type: 'string', description: 'param desc'}
508+
],
509+
returns: {type: 'number', description: 'return desc'}
510+
});
511+
doc.html_usage_function(dom);
512+
expect(dom).toContain('some.name([a][, b], c)'); //TODO(i) the comma position here is lame
513+
expect(dom).toContain('param desc');
514+
expect(dom).toContain('(optional="xxx")');
515+
expect(dom).toContain('return desc');
516+
});
517+
});
518+
499519
describe('filter', function(){
500520
it('should format', function(){
501521
var doc = new Doc({

0 commit comments

Comments
 (0)