Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit 67b3682

Browse files
committed
feat: remove q-promise-utils
Use promiseUtils from gemini-core on bluebird instead q-promise-utils
1 parent 7fc2bb8 commit 67b3682

File tree

6 files changed

+128
-118
lines changed

6 files changed

+128
-118
lines changed

lib/capture-session/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
const inherit = require('inherit');
44
const _ = require('lodash');
5+
const Promise = require('bluebird');
56
const debug = require('debug');
6-
const promiseUtil = require('q-promise-utils');
7+
78
const ActionsBuilder = require('../tests-api/actions-builder');
89
const Browser = require('../browser');
910
const temp = require('../temp');
@@ -25,7 +26,7 @@ var CaptureSession = inherit({
2526

2627
runActions: function(actions) {
2728
this.log('run actions');
28-
return promiseUtil.sequence(actions, this.browser, new ActionsBuilder(this._postActions));
29+
return Promise.mapSeries(actions, (a) => a(this.browser, new ActionsBuilder(this._postActions)));
2930
},
3031

3132
prepareScreenshot: function(state) {
@@ -45,7 +46,7 @@ var CaptureSession = inherit({
4546
},
4647

4748
runPostActions: function() {
48-
return promiseUtil.sequence(this._postActions.reverse(), this.browser);
49+
return Promise.mapSeries(this._postActions.reverse(), (a) => a(this.browser));
4950
},
5051

5152
extendWithPageScreenshot: function(obj) {

lib/runner/browser-runner/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
const _ = require('lodash');
44
const url = require('url');
55
const path = require('path');
6-
const promiseUtils = require('q-promise-utils');
7-
const BrowserAgent = require('gemini-core').BrowserAgent;
6+
const {BrowserAgent, promiseUtils} = require('gemini-core');
87
const Runner = require('../runner');
98
const SuiteRunner = require('../suite-runner');
109
const Events = require('../../constants/events');

lib/runner/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict';
22

3-
const Promise = require('bluebird');
43
const _ = require('lodash');
5-
const promiseUtils = require('q-promise-utils');
4+
const {promiseUtils} = require('gemini-core');
65

76
const pool = require('../browser-pool');
87
const BrowserRunner = require('./browser-runner');
@@ -37,7 +36,7 @@ module.exports = class TestsRunner extends Runner {
3736
}
3837

3938
run(suiteCollection) {
40-
return Promise.resolve(this.emitAndWait(Events.START_RUNNER, this))
39+
return this.emitAndWait(Events.START_RUNNER, this)
4140
.then(() => this.emit(Events.BEGIN, this._formatBeginEventData(suiteCollection)))
4241
.then(() => this._stateProcessor.prepare(this))
4342
.then(() => !this._cancelled && this._runTests(suiteCollection))

package-lock.json

Lines changed: 62 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"node-fetch": "^1.6.3",
3333
"plugins-loader": "^1.1.0",
3434
"png-img": "^2.1.0",
35-
"q-promise-utils": "^1.1.0",
3635
"resolve": "^1.1.0",
3736
"sizzle": "^2.2.0",
3837
"source-map": "^0.5.3",

0 commit comments

Comments
 (0)