wdio-docker-service
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -31,3 +31,12 @@ { | ||
"sourceType": "module" | ||
}, | ||
"globals": { | ||
"describe": true, | ||
"context": true, | ||
"it": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"after": true, | ||
"afterEach": true | ||
} | ||
} |
@@ -9,4 +9,2 @@ 'use strict'; | ||
const SPACE = ' '; | ||
const COLORS = { | ||
@@ -21,15 +19,15 @@ INFO: _chalk2.default.hex('#6495ED'), | ||
info(...msg) { | ||
this._writeLog('info', msg.join(SPACE), COLORS.INFO); | ||
this._writeLog('info', msg, COLORS.INFO); | ||
}, | ||
error(...msg) { | ||
this._writeLog('error', msg.join(SPACE), COLORS.ERROR); | ||
this._writeLog('error', msg, COLORS.ERROR); | ||
}, | ||
warn(...msg) { | ||
this._writeLog('warn', msg.join(SPACE), COLORS.WARN); | ||
this._writeLog('warn', msg, COLORS.WARN); | ||
}, | ||
log(...msg) { | ||
this._writeLog('log', msg.join(SPACE)); | ||
this._writeLog('log', msg); | ||
}, | ||
@@ -44,3 +42,4 @@ | ||
_writeLog(method, msg, color = COLORS.LOG) { | ||
console[method](color(msg)); | ||
const [first, ...rest] = msg; | ||
console[method](color(first), ...rest); | ||
} | ||
@@ -47,0 +46,0 @@ }; |
@@ -35,2 +35,6 @@ 'use strict'; | ||
var _dockerEventsListener = require('./dockerEventsListener'); | ||
var _dockerEventsListener2 = _interopRequireDefault(_dockerEventsListener); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -73,2 +77,3 @@ | ||
this.process = null; | ||
this.dockerEventsListener = new _dockerEventsListener2.default(debug, logger); | ||
@@ -101,3 +106,12 @@ if (typeof healthCheck === 'string') { | ||
this.debug && this.logger.log(`Docker command: ${this.dockerRunCommand}`); | ||
this.dockerEventsListener.connect({ | ||
filter: `image=${this.image}` | ||
}); | ||
if (this.debug) { | ||
this.dockerEventsListener.once('image.pull', event => { | ||
this.logger.info('Pulling image:', JSON.stringify(event, null, 4)); | ||
}); | ||
} | ||
return this._removeStaleContainer().then(() => { | ||
@@ -123,2 +137,10 @@ return this._isImagePresent().catch(() => { | ||
}); | ||
this.dockerEventsListener.once('container.start', event => { | ||
this.logger.info('Container started:', JSON.stringify(event, null, 4)); | ||
}); | ||
this.dockerEventsListener.once('container.stop', event => { | ||
this.logger.info('Container stopped:', JSON.stringify(event, null, 4)); | ||
}); | ||
} | ||
@@ -150,2 +172,3 @@ | ||
this.debug && this.logger.info('Docker container has stopped'); | ||
this.dockerEventsListener.disconnect(); | ||
}); | ||
@@ -167,3 +190,3 @@ } | ||
if (url == undefined) { | ||
if (url === undefined) { | ||
return _bluebird2.default.resolve(); | ||
@@ -170,0 +193,0 @@ } |
{ | ||
"name": "wdio-docker-service", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "WebdriverIO service to start and stop docker container (for Selenium and more)", | ||
@@ -16,5 +16,5 @@ "repository": { | ||
"build": "rm -rf lib && babel src --out-dir lib -s > /dev/null", | ||
"test": "eslint -c .eslintrc.json src/**/*.js && npm run test:unit && npm run test:integration", | ||
"test": "eslint -c .eslintrc.json src test && npm run test:unit && npm run test:integration", | ||
"test:unit": "nyc mocha --require babel-register --recursive ./test/unit", | ||
"test:integration": "wdio test/integration/docker-selenium/wdio.conf.js && wdio test/integration/docker-app/wdio.conf.js", | ||
"test:integration": "npm run build && wdio test/integration/docker-selenium/wdio.conf.js && wdio test/integration/docker-app/wdio.conf.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
@@ -36,9 +36,9 @@ }, | ||
"babel-register": "^6.26.0", | ||
"chai": "^4.1.2", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.0.2", | ||
"eslint": "^5.5.0", | ||
"eslint": "^5.6.1", | ||
"gulp": "^3.9.1", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1", | ||
"sinon": "^6.2.0", | ||
"sinon": "^6.3.4", | ||
"wdio-mocha-framework": "^0.6.3", | ||
@@ -45,0 +45,0 @@ "wdio-selenium-standalone-service": "0.0.10", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70091
10562
28
721
3