wdio-docker-service
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -1,2 +0,2 @@ | ||
172.17.0.1 - - [31/May/2018:04:03:17 +0000] "GET / HTTP/1.1" 200 174 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" "-" | ||
172.17.0.1 - - [31/May/2018:04:03:20 +0000] "GET / HTTP/1.1" 200 174 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/66.0.3359.181 Safari/537.36" "-" | ||
172.17.0.1 - - [07/Sep/2018:02:01:02 +0000] "GET / HTTP/1.1" 200 174 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" "-" | ||
172.17.0.1 - - [07/Sep/2018:02:01:05 +0000] "GET / HTTP/1.1" 200 174 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/68.0.3440.106 Safari/537.36" "-" |
@@ -51,3 +51,3 @@ 'use strict'; | ||
const Logger = coloredLogs ? require('./utils/color-logger') : console; | ||
const Logger = coloredLogs ? require('./utils/colorLogger') : console; | ||
@@ -54,0 +54,0 @@ this.docker = new _docker2.default(image, { |
@@ -7,8 +7,4 @@ 'use strict'; | ||
var _camelToDash = require('./camel-to-dash'); | ||
var _deepMerge = require('./deepMerge'); | ||
var _camelToDash2 = _interopRequireDefault(_camelToDash); | ||
var _deepMerge = require('./deep-merge'); | ||
var _deepMerge2 = _interopRequireDefault(_deepMerge); | ||
@@ -28,6 +24,10 @@ | ||
var _childProcess = require('./child-process'); | ||
var _childProcess = require('./childProcess'); | ||
var _events = require('events'); | ||
var _optionsSerializer = require('./optionsSerializer'); | ||
var _optionsSerializer2 = _interopRequireDefault(_optionsSerializer); | ||
var _bluebird = require('bluebird'); | ||
@@ -83,3 +83,3 @@ | ||
const cmdChain = ['docker run'].concat(Docker.serializeOptions(this.options), [this.image]); | ||
const cmdChain = ['docker run'].concat((0, _optionsSerializer2.default)(this.options), [this.image]); | ||
@@ -228,47 +228,2 @@ if (this.command) { | ||
* @static | ||
* @param {Object} opt Options to serialize | ||
* @return {Array} | ||
*/ | ||
static serializeOptions(opt) { | ||
return Object.keys(opt).reduce((acc, key) => { | ||
const fixedKey = (0, _camelToDash2.default)(key); | ||
const value = opt[key]; | ||
const option = Docker.serializeOption(fixedKey, value); | ||
if (option) { | ||
if (Array.isArray(option)) { | ||
return acc.concat(option); | ||
} | ||
acc.push(option); | ||
} | ||
return acc; | ||
}, []); | ||
} | ||
/** | ||
* @static | ||
* @param {String} key | ||
* @param {*} value | ||
* @return {String|Array} | ||
*/ | ||
static serializeOption(key, value) { | ||
const prefix = key.length > 1 ? '--' : '-'; | ||
if (typeof value === 'boolean' && value) { | ||
return `${prefix}${key}`; | ||
} | ||
if (typeof value === 'string') { | ||
return `${prefix}${key} ${value}`; | ||
} | ||
if (Array.isArray(value)) { | ||
return value.reduce((acc, item) => { | ||
acc.push(`${prefix}${key} ${item}`); | ||
return acc; | ||
}, []); | ||
} | ||
} | ||
/** | ||
* @static | ||
* @param {String} cid Container id | ||
@@ -275,0 +230,0 @@ * @return {Promise} |
{ | ||
"name": "wdio-docker-service", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "WebdriverIO service to start and stop docker container (for Selenium and more)", | ||
@@ -36,12 +36,12 @@ "repository": { | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.1", | ||
"eslint": "^4.19.1", | ||
"coveralls": "^3.0.2", | ||
"eslint": "^5.3.0", | ||
"gulp": "^3.9.1", | ||
"mocha": "^5.2.0", | ||
"nyc": "^11.8.0", | ||
"sinon": "^5.0.10", | ||
"wdio-mocha-framework": "^0.5.13", | ||
"nyc": "^12.0.2", | ||
"sinon": "^6.1.5", | ||
"wdio-mocha-framework": "^0.6.2", | ||
"wdio-selenium-standalone-service": "0.0.10", | ||
"wdio-spec-reporter": "^0.1.4", | ||
"webdriverio": "^4.12.0" | ||
"wdio-spec-reporter": "^0.1.5", | ||
"webdriverio": "^4.13.1" | ||
}, | ||
@@ -51,4 +51,4 @@ "dependencies": { | ||
"chalk": "^2.4.1", | ||
"fs-extra": "^6.0.1", | ||
"node-fetch": "^2.1.2" | ||
"fs-extra": "^7.0.0", | ||
"node-fetch": "^2.2.0" | ||
}, | ||
@@ -55,0 +55,0 @@ "contributors": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
221588
54
656
2
+ Addedfs-extra@7.0.1(transitive)
- Removedfs-extra@6.0.1(transitive)
Updatedfs-extra@^7.0.0
Updatednode-fetch@^2.2.0