1- describe ( '$q decorator' , function ( ) {
1+ describe ( '$q decorator' , function ( ) {
22 beforeEach ( module ( 'angular-data.DS' ) ) ;
33
4- it ( 'should decorate $q' , inject ( function ( $q ) {
4+ it ( 'should decorate $q' , inject ( function ( $q ) {
55 assert . isFunction ( $q . promisify ) ;
66 } ) ) ;
77
8- it ( 'should resolve with a cb' , inject ( function ( $q , $rootScope ) {
8+ it ( 'should resolve with a cb' , inject ( function ( $q , $rootScope ) {
99 var resolveValue = { } ;
10- var resolveCb = function ( cb ) {
10+ var resolveCb = function ( cb ) {
1111 cb ( null , resolveValue ) ;
1212 } ;
1313 var resolveSpy = sinon . spy ( ) ;
@@ -18,9 +18,9 @@ describe('$q decorator', function(){
1818 assert ( resolveSpy . calledWith ( resolveValue ) ) ;
1919 } ) ) ;
2020
21- it ( 'should reject with a cb' , inject ( function ( $q , $rootScope ) {
21+ it ( 'should reject with a cb' , inject ( function ( $q , $rootScope ) {
2222 var rejectValue = { } ;
23- var rejectCb = function ( cb ) {
23+ var rejectCb = function ( cb ) {
2424 cb ( rejectValue ) ;
2525 } ;
2626 var rejectSpy = sinon . spy ( ) ;
@@ -31,9 +31,9 @@ describe('$q decorator', function(){
3131 assert ( rejectSpy . calledWith ( rejectValue ) ) ;
3232 } ) ) ;
3333
34- it ( 'should resolve with a promise' , inject ( function ( $q , $rootScope ) {
34+ it ( 'should resolve with a promise' , inject ( function ( $q , $rootScope ) {
3535 var resolveValue = { } ;
36- var resolveCb = function ( cb ) {
36+ var resolveCb = function ( ) {
3737 return $q . when ( resolveValue ) ;
3838 } ;
3939 var resolveSpy = sinon . spy ( ) ;
@@ -44,9 +44,9 @@ describe('$q decorator', function(){
4444 assert ( resolveSpy . calledWith ( resolveValue ) ) ;
4545 } ) ) ;
4646
47- it ( 'should reject with a promise' , inject ( function ( $q , $rootScope ) {
47+ it ( 'should reject with a promise' , inject ( function ( $q , $rootScope ) {
4848 var rejectValue = { } ;
49- var rejectCb = function ( cb ) {
49+ var rejectCb = function ( ) {
5050 return $q . reject ( rejectValue ) ;
5151 } ;
5252 var rejectSpy = sinon . spy ( ) ;
@@ -60,12 +60,12 @@ describe('$q decorator', function(){
6060 //Typically, functions that return a promise will be wrapped with a $q.when, meaning if you were to return nothing, it would execute straight away
6161 //This would mean the cb style would not work at all, as any developer that uses cb would have the function immediately resolve
6262 //This just ensures that doesn't ever happen
63- it ( 'should not resolve or reject if return value is not a promise' , inject ( function ( $q , $rootScope ) {
63+ it ( 'should not resolve or reject if return value is not a promise' , inject ( function ( $q , $rootScope ) {
6464 var resolve ;
65- var cb = function ( next ) {
65+ var cb = function ( next ) {
6666 resolve = next ;
6767 return true ;
68- }
68+ } ;
6969 var spy = sinon . spy ( ) ;
7070
7171 $q . promisify ( cb ) ( ) . finally ( spy ) ;
@@ -78,4 +78,4 @@ describe('$q decorator', function(){
7878
7979 assert ( spy . called ) ;
8080 } ) ) ;
81- } )
81+ } ) ;
0 commit comments