wdio-docker-service
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "wdio-docker-service", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "WebdriverIO service to start and stop docker container (for Selenium and more)", | ||
@@ -48,2 +48,3 @@ "repository": { | ||
"dependencies": { | ||
"bluebird": "^3.5.1", | ||
"chalk": "^2.3.0", | ||
@@ -50,0 +51,0 @@ "fs-extra": "^5.0.0", |
import fs from 'fs-extra'; | ||
import Docker from './utils/docker'; | ||
import getFilePath from './utils/getFilePath'; | ||
import Promise from 'bluebird'; | ||
@@ -5,0 +6,0 @@ const DEFAULT_LOG_FILENAME = 'docker-log.txt'; |
import { spawn } from 'child_process'; | ||
import Promise from 'bluebird'; | ||
@@ -3,0 +4,0 @@ const SPACE = ' '; |
@@ -8,2 +8,3 @@ import camelToDash from './camel-to-dash'; | ||
import { EventEmitter } from 'events'; | ||
import Promise from 'bluebird'; | ||
@@ -13,3 +14,2 @@ const SPACE = ' '; | ||
const MAX_INSPECT_ATTEMPTS = 10; | ||
const DEFAULT_HEALTH_CHECK = 'http://localhost:4444'; | ||
const DEFAULT_OPTIONS = { | ||
@@ -25,4 +25,4 @@ rm: true | ||
* @param {String} image Docker image/tag name | ||
* @param {Boolean} debug Enables logging | ||
* @param {Object} options | ||
* @param {Boolean} [debug] Enables logging | ||
* @param {Object} [options] Docker run options | ||
* @param {String} [healthCheck] Url that verifies that service is running | ||
@@ -33,10 +33,14 @@ * @param {String} [command] docker command that follows image/tag name | ||
*/ | ||
constructor(image, { debug = false, options = {}, healthCheck, command, args }, logger) { | ||
constructor(image, { debug = false, options = {}, healthCheck, command, args } = {}, logger = console) { | ||
super(); | ||
if (!image) { | ||
throw new Error('Missing required image argument'); | ||
} | ||
this.args = args; | ||
this.cidfile = path.join(process.cwd(), `${ image.replace(/\W+/g, '_') }.cid`); | ||
this.command = command; | ||
this.debug = debug; | ||
this.healthCheck = healthCheck || DEFAULT_HEALTH_CHECK; | ||
this.debug = Boolean(debug); | ||
this.healthCheck = healthCheck; | ||
this.image = image; | ||
@@ -118,2 +122,3 @@ this.logger = logger; | ||
this.process.kill(); | ||
this.process = null; | ||
} | ||
@@ -230,3 +235,3 @@ | ||
if (typeof value === 'boolean') { | ||
if (typeof value === 'boolean' && value) { | ||
return `${prefix}${key}`; | ||
@@ -233,0 +238,0 @@ } |
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
137861
47
1602
4
5
+ Addedbluebird@^3.5.1
+ Addedbluebird@3.7.2(transitive)