Replace when with native Promise

This commit is contained in:
Nicolas Dextraze
2016-03-09 16:09:18 -08:00
parent f948410140
commit 05e693d7b9
7 changed files with 26 additions and 34 deletions

View File

@ -1,5 +1,4 @@
var util = require('util');
var when = require('when');
var uuid = require('uuid');
var client = require('../src/client');
var NoopLogger = require('../src/common/log/noopLogger');
@ -72,11 +71,11 @@ module.exports = {
this.conn.startTransaction(testStreamName, client.expectedVersion.any)
.then(function(trx) {
test.ok(trx, "No transaction.");
return when.join(trx, trx.write([createRandomEvent()]));
return Promise.all([trx, trx.write([createRandomEvent()])]);
})
.then(function(args) {
var trx = args[0];
return when.join(trx, trx.write([createRandomEvent()]));
return Promise.all([trx, trx.write([createRandomEvent()])]);
})
.then(function(args) {
var trx = args[0];