Navigation Menu

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

Commit

Permalink
feat: remove q-promise-utils
Browse files Browse the repository at this point in the history
Use promiseUtils from gemini-core on bluebird instead q-promise-utils
  • Loading branch information
DudaGod committed Nov 4, 2017
1 parent 7fc2bb8 commit 67b3682
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 118 deletions.
7 changes: 4 additions & 3 deletions lib/capture-session/index.js
Expand Up @@ -2,8 +2,9 @@

const inherit = require('inherit');
const _ = require('lodash');
const Promise = require('bluebird');
const debug = require('debug');
const promiseUtil = require('q-promise-utils');

const ActionsBuilder = require('../tests-api/actions-builder');
const Browser = require('../browser');
const temp = require('../temp');
Expand All @@ -25,7 +26,7 @@ var CaptureSession = inherit({

runActions: function(actions) {
this.log('run actions');
return promiseUtil.sequence(actions, this.browser, new ActionsBuilder(this._postActions));
return Promise.mapSeries(actions, (a) => a(this.browser, new ActionsBuilder(this._postActions)));
},

prepareScreenshot: function(state) {
Expand All @@ -45,7 +46,7 @@ var CaptureSession = inherit({
},

runPostActions: function() {
return promiseUtil.sequence(this._postActions.reverse(), this.browser);
return Promise.mapSeries(this._postActions.reverse(), (a) => a(this.browser));
},

extendWithPageScreenshot: function(obj) {
Expand Down
3 changes: 1 addition & 2 deletions lib/runner/browser-runner/index.js
Expand Up @@ -3,8 +3,7 @@
const _ = require('lodash');
const url = require('url');
const path = require('path');
const promiseUtils = require('q-promise-utils');
const BrowserAgent = require('gemini-core').BrowserAgent;
const {BrowserAgent, promiseUtils} = require('gemini-core');
const Runner = require('../runner');
const SuiteRunner = require('../suite-runner');
const Events = require('../../constants/events');
Expand Down
5 changes: 2 additions & 3 deletions lib/runner/index.js
@@ -1,8 +1,7 @@
'use strict';

const Promise = require('bluebird');
const _ = require('lodash');
const promiseUtils = require('q-promise-utils');
const {promiseUtils} = require('gemini-core');

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

run(suiteCollection) {
return Promise.resolve(this.emitAndWait(Events.START_RUNNER, this))
return this.emitAndWait(Events.START_RUNNER, this)
.then(() => this.emit(Events.BEGIN, this._formatBeginEventData(suiteCollection)))
.then(() => this._stateProcessor.prepare(this))
.then(() => !this._cancelled && this._runTests(suiteCollection))
Expand Down
130 changes: 62 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -32,7 +32,6 @@
"node-fetch": "^1.6.3",
"plugins-loader": "^1.1.0",
"png-img": "^2.1.0",
"q-promise-utils": "^1.1.0",
"resolve": "^1.1.0",
"sizzle": "^2.2.0",
"source-map": "^0.5.3",
Expand Down

0 comments on commit 67b3682

Please sign in to comment.