@@ -80,13 +80,19 @@ describe('Ember Serve Task', function() {
80
80
serve . stubEmberAddon ( cloned ) ;
81
81
} ) ;
82
82
83
- it ( 'stubs treeFor function' , function ( ) {
83
+ it ( 'stubs valid ember addon /w treeFor function' , function ( ) {
84
+ let stubbedAddon = cloned . addons [ 0 ] ;
84
85
expect ( cloned . addons . length ) . to . equal ( 1 ) ;
85
- expect ( cloned . addons [ 0 ] . treeFor ) . to . be . a ( 'function' ) ;
86
+ expect ( stubbedAddon . treeFor ) . to . be . a ( 'function' ) ;
87
+ expect ( stubbedAddon . pkg ) . to . deep . equal ( { 'ember-addon' : { } } ) ;
88
+ expect ( stubbedAddon . root ) . to . equal ( 'corber-livereload' ) ;
89
+ expect ( stubbedAddon . name ) . to . equal ( 'corber-livereload' ) ;
90
+ expect ( stubbedAddon . addons ) . to . be . a ( 'array' ) ;
91
+ expect ( stubbedAddon . addons . length ) . to . equal ( 0 ) ;
86
92
} ) ;
87
93
88
- it ( 'creates a new Broccoli Funnel with cordova-assets paths ' , function ( ) {
89
- cloned . addons [ 0 ] . treeFor ( ) ;
94
+ it ( 'when treeFor is addon, it creates a Funnel with cordova-assets' , function ( ) {
95
+ cloned . addons [ 0 ] . treeFor ( 'addon' ) ;
90
96
91
97
td . verify ( new Funnel (
92
98
'corber/cordova' , {
@@ -95,5 +101,11 @@ describe('Ember Serve Task', function() {
95
101
}
96
102
) ) ;
97
103
} ) ;
104
+
105
+ it ( 'when treeFor is not addon, it does nothing' , function ( ) {
106
+ cloned . addons [ 0 ] . treeFor ( 'app' ) ;
107
+
108
+ td . verify ( new Funnel ( ) , { times : 0 } ) ;
109
+ } ) ;
98
110
} ) ;
99
111
} ) ;
0 commit comments