@@ -100,7 +100,7 @@ describe('$firebaseStorage', function () {
100100 spyOn ( ref , 'put' ) . and . returnValue ( mockTask ) ;
101101 $task = $firebaseStorage . utils . _$put ( ref , file , digestFn , $q ) ;
102102 expect ( $task . _task ( ) ) . toEqual ( mockTask ) ;
103- } ) ;
103+ } ) ;
104104
105105 it ( '$cancel' , function ( ) {
106106 var mockTask = new MockTask ( ) ;
@@ -258,7 +258,7 @@ describe('$firebaseStorage', function () {
258258 spyOn ( ref , 'put' ) ;
259259 spyOn ( $firebaseStorage . utils , '_$put' ) . and . returnValue ( fakePromise ) ;
260260 storage . $put ( 'file' ) ; // don't ever call this with a string
261- expect ( $firebaseStorage . utils . _$put ) . toHaveBeenCalledWith ( ref , 'file' , $firebaseUtils . compile , $q ) ;
261+ expect ( $firebaseStorage . utils . _$put ) . toHaveBeenCalledWith ( ref , 'file' , $firebaseUtils . compile , $q ) ;
262262 } )
263263
264264 } ) ;
@@ -328,36 +328,34 @@ describe('$firebaseStorage', function () {
328328 } ) ;
329329} ) ;
330330
331-
332- class MockTask {
333-
334- on ( event , successCallback , errorCallback , completionCallback ) {
331+ /**
332+ * A Mock for Firebase Storage Tasks. It has the same .on() method signature
333+ * but it simply stores the callbacks without doing anything. To make something
334+ * happen you call the makeProgress(), causeError(), or complete() methods. The
335+ * empty methods are intentional noops.
336+ */
337+ var MockTask = ( function ( ) {
338+ function MockTask ( ) {
339+ }
340+ MockTask . prototype . on = function ( event , successCallback , errorCallback , completionCallback ) {
335341 this . event = event ;
336342 this . successCallback = successCallback ;
337343 this . errorCallback = errorCallback ;
338344 this . completionCallback = completionCallback ;
339- }
340-
341- makeProgress ( ) {
345+ } ;
346+ MockTask . prototype . makeProgress = function ( ) {
342347 this . successCallback ( ) ;
343- }
344-
345- causeError ( ) {
348+ } ;
349+ MockTask . prototype . causeError = function ( ) {
346350 this . errorCallback ( ) ;
347- }
348-
349- complete ( ) {
351+ } ;
352+ MockTask . prototype . complete = function ( ) {
350353 this . completionCallback ( ) ;
351- }
352-
353- cancel ( ) { }
354-
355- resume ( ) { }
356-
357- pause ( ) { }
358-
359- then ( ) { }
360-
361- catch ( ) { }
362-
363- }
354+ } ;
355+ MockTask . prototype . cancel = function ( ) { } ;
356+ MockTask . prototype . resume = function ( ) { } ;
357+ MockTask . prototype . pause = function ( ) { } ;
358+ MockTask . prototype . then = function ( ) { } ;
359+ MockTask . prototype . catch = function ( ) { } ;
360+ return MockTask ;
361+ } ( ) ) ;
0 commit comments