Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wall authored and grs committed Nov 21, 2019
1 parent b93d2f1 commit 006d88f
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions test/sasl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ describe('sasl plain callback using promise', function() {

function authenticate(username: string, password: string) {
return new Promise((resolve, reject) => {
if (providerFailure) {
reject("provider failure");
} else {
resolve(username.split("").reverse().join("") === password);
}
process.nextTick(() => {
if (providerFailure) {
reject("provider failure");
} else {
resolve(username.split("").reverse().join("") === password);
}
})
});
}

Expand Down Expand Up @@ -287,10 +289,21 @@ describe('user-provided sasl mechanism', function () {
return {
outcome: undefined,
start: function () {
return new Promise(resolve => { startCalled = true; resolve('initialResponse'); });
return new Promise(resolve => {
process.nextTick(() => {
startCalled = true;
resolve('initialResponse');
});
});
},
step: function () {
return new Promise(resolve => { stepCalled = true; this.outcome = <any>true; resolve(); });
return new Promise(resolve => {
process.nextTick(() => {
stepCalled = true;
this.outcome = <any>true;
resolve();
});
});
}
};
};
Expand Down

0 comments on commit 006d88f

Please sign in to comment.