Skip to content

Commit

Permalink
directly use promises in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wzrdtales committed Nov 30, 2016
1 parent 85bde6d commit ecae49b
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions test/integration/api_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ lab.experiment('api', { parallel: true }, function() {
});

lab.test('should handle all up parameter variations properly',
{ parallel: true }, function(done) {
{ parallel: true }, function() {

Promise.resolve([
return Promise.resolve([
[], // promise
[sinon.spy()],
['nameatargetmigration', sinon.spy()], // targeted migration
Expand All @@ -126,14 +126,13 @@ lab.experiment('api', { parallel: true }, function() {
[1, 'testscope'] // promise scope target
])
.each(defaultExecParams('up'))
.each(spyCallback)
.asCallback(done);
.each(spyCallback);
});

lab.test('should handle all down parameter variations properly',
{ parallel: true }, function(done) {
{ parallel: true }, function() {

Promise.resolve([
return Promise.resolve([
[], // promise
[sinon.spy()],
[1, sinon.spy()], // targeted migration
Expand All @@ -142,37 +141,34 @@ lab.experiment('api', { parallel: true }, function() {
[1, 'testscope'] // promise scope target
])
.each(defaultExecParams('down'))
.each(spyCallback)
.asCallback(done);
.each(spyCallback);
});

lab.test('should handle all reset parameter variations properly',
{ parallel: true }, function(done) {
{ parallel: true }, function() {

Promise.resolve([
return Promise.resolve([
[], // promise
[sinon.spy()],
['testscope', sinon.spy()], // scoped target
['testscope'] // promise scope target
])
.each(defaultExecParams('reset'))
.each(spyCallback)
.asCallback(done);
.each(spyCallback);
});

lab.test('should handle all sync parameter variations properly',
{ parallel: true }, function(done) {
{ parallel: true }, function() {

Promise.resolve([
return Promise.resolve([
[],
['nameatargetmigration', sinon.spy()], // targeted migration
['nameatargetmigration'], // promise targeted migration
['nameatargetmigration', 'testscope', sinon.spy()], // scoped target
['nameatargetmigration', 'testscope'], // promise scope target
])
.each(defaultExecParams('sync'))
.each(spyCallback)
.asCallback(done);
.each(spyCallback);
});
});

Expand Down

0 comments on commit ecae49b

Please sign in to comment.