Skip to content

Commit ecae49b

Browse files
committed
directly use promises in tests
1 parent 85bde6d commit ecae49b

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

test/integration/api_test.js

+12-16
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ lab.experiment('api', { parallel: true }, function() {
111111
});
112112

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

116-
Promise.resolve([
116+
return Promise.resolve([
117117
[], // promise
118118
[sinon.spy()],
119119
['nameatargetmigration', sinon.spy()], // targeted migration
@@ -126,14 +126,13 @@ lab.experiment('api', { parallel: true }, function() {
126126
[1, 'testscope'] // promise scope target
127127
])
128128
.each(defaultExecParams('up'))
129-
.each(spyCallback)
130-
.asCallback(done);
129+
.each(spyCallback);
131130
});
132131

133132
lab.test('should handle all down parameter variations properly',
134-
{ parallel: true }, function(done) {
133+
{ parallel: true }, function() {
135134

136-
Promise.resolve([
135+
return Promise.resolve([
137136
[], // promise
138137
[sinon.spy()],
139138
[1, sinon.spy()], // targeted migration
@@ -142,37 +141,34 @@ lab.experiment('api', { parallel: true }, function() {
142141
[1, 'testscope'] // promise scope target
143142
])
144143
.each(defaultExecParams('down'))
145-
.each(spyCallback)
146-
.asCallback(done);
144+
.each(spyCallback);
147145
});
148146

149147
lab.test('should handle all reset parameter variations properly',
150-
{ parallel: true }, function(done) {
148+
{ parallel: true }, function() {
151149

152-
Promise.resolve([
150+
return Promise.resolve([
153151
[], // promise
154152
[sinon.spy()],
155153
['testscope', sinon.spy()], // scoped target
156154
['testscope'] // promise scope target
157155
])
158156
.each(defaultExecParams('reset'))
159-
.each(spyCallback)
160-
.asCallback(done);
157+
.each(spyCallback);
161158
});
162159

163160
lab.test('should handle all sync parameter variations properly',
164-
{ parallel: true }, function(done) {
161+
{ parallel: true }, function() {
165162

166-
Promise.resolve([
163+
return Promise.resolve([
167164
[],
168165
['nameatargetmigration', sinon.spy()], // targeted migration
169166
['nameatargetmigration'], // promise targeted migration
170167
['nameatargetmigration', 'testscope', sinon.spy()], // scoped target
171168
['nameatargetmigration', 'testscope'], // promise scope target
172169
])
173170
.each(defaultExecParams('sync'))
174-
.each(spyCallback)
175-
.asCallback(done);
171+
.each(spyCallback);
176172
});
177173
});
178174

0 commit comments

Comments
 (0)