mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-20 00:10:26 +00:00
test(ngdoc): add test for @ngdoc function
This commit is contained in:
parent
345c01c81b
commit
9e37ebe635
1 changed files with 20 additions and 0 deletions
|
|
@ -496,6 +496,26 @@ describe('ngdoc', function(){
|
|||
});
|
||||
|
||||
|
||||
describe('function', function(){
|
||||
it('should format', function(){
|
||||
var doc = new Doc({
|
||||
ngdoc:'function',
|
||||
name:'some.name',
|
||||
param: [
|
||||
{name:'a', optional: true},
|
||||
{name:'b', type: 'someType', optional: true, 'default': '"xxx"'},
|
||||
{name:'c', type: 'string', description: 'param desc'}
|
||||
],
|
||||
returns: {type: 'number', description: 'return desc'}
|
||||
});
|
||||
doc.html_usage_function(dom);
|
||||
expect(dom).toContain('some.name([a][, b], c)'); //TODO(i) the comma position here is lame
|
||||
expect(dom).toContain('param desc');
|
||||
expect(dom).toContain('(optional="xxx")');
|
||||
expect(dom).toContain('return desc');
|
||||
});
|
||||
});
|
||||
|
||||
describe('filter', function(){
|
||||
it('should format', function(){
|
||||
var doc = new Doc({
|
||||
|
|
|
|||
Loading…
Reference in a new issue