Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

correct promises chain

  • Loading branch information...
commit 532d798ab38a4d6912c8def99f8e0d283e937439 1 parent beabcdb
@andriykuba authored
Showing with 12 additions and 15 deletions.
  1. +12 −15 test/functional.js
View
27 test/functional.js
@@ -337,28 +337,25 @@ describe('Debitoor', function(){
tools
.modifyCustomers()
.then(function(){
-
- importContacts('update')
- .then(function(res){
- checkImportedContactsEquals(res, done);
- })
- .fail(done);
-
+ return importContacts('update')
+ })
+ .then(function(res){
+ checkImportedContactsEquals(res, done);
})
.fail(done);
});
it('only contacts that is not present as customers', function(done){
+
+ var modifyed = null;
tools
.modifyCustomers()
- .then(function(modifyed){
-
- importContacts('ignore')
- .then(function (res){
- checkImportedContactsDifferent(modifyed, res, done);
- })
- .fail(done);
-
+ .then(function(res){
+ modifyed = res;
+ return importContacts('ignore')
+ })
+ .then(function (res){
+ checkImportedContactsDifferent(modifyed, res, done);
})
.fail(done);
});
Please sign in to comment.
Something went wrong with that request. Please try again.