dusk-runner
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -8,3 +8,6 @@ /* | ||
const log = require('debug-logger')('DuskRunner') | ||
const handlers = [] | ||
module.exports = function (callback) { | ||
@@ -14,2 +17,3 @@ if (typeof (callback) === 'function') handlers.push(callback) | ||
process.on('cleanup', () => { | ||
log.debug('Exiting. Process cleanup...') | ||
handlers.forEach(handler => handler()) | ||
@@ -19,10 +23,9 @@ }) | ||
process.on('SIGINT', function () { | ||
console.log('CTRL + C ... exiting') | ||
log.info('CTRL + C ... exiting') | ||
process.exit(2) | ||
}) | ||
process.on('uncaughtException', function (e) { | ||
console.log('uncaughtException ...') | ||
console.log(e.stack) | ||
log.error(e) | ||
process.exit(99) | ||
}) | ||
} |
const spawn = require('cross-spawn') | ||
const log = require('debug-logger')('DuskRunner') | ||
@@ -6,2 +7,3 @@ module.exports = function (env) { | ||
log.info('Start dusk tests.') | ||
const tests = spawn( | ||
@@ -8,0 +10,0 @@ 'php', |
@@ -9,13 +9,13 @@ /* | ||
const spawn = require('cross-spawn') | ||
const log = require('debug-logger')('DuskRunner:Laravel') | ||
const log = require('debug')('DuskRunner:Laravel') | ||
process.env.DEBUG = process.env.DEBUG || 'DuskRunner:Laravel*' | ||
function start(config, resolve, reject) { | ||
function start({ serve, host, port, env }, resolve, reject) { | ||
let started = false | ||
if (!config.serve) { | ||
log('No need for laravel serve.') | ||
if (!serve) { | ||
log.info('No need for laravel serve.') | ||
@@ -27,7 +27,7 @@ return resolve() | ||
log('Starting laravel server...') | ||
log.debug('Starting laravel server...', { host, port, env }) | ||
const laravel = spawn('php', | ||
['artisan', 'serve', `--host=${config.host}`, `--port=${config.port}`, `--env=${config.env}`], | ||
{ env: process.env, shell: true } | ||
['artisan', 'serve', `--host=${host}`, `--port=${port}`, `--env=${env}`], | ||
{ env: process.env, detached: true } | ||
) | ||
@@ -39,9 +39,9 @@ | ||
laravel.on('error', error => log(error)) | ||
laravel.on('close', code => log(`Laravel server exited with code ${code}`)) | ||
laravel.stderr.on('data', data => log(data.toString())) | ||
laravel.on('error', error => log.error(error)) | ||
laravel.on('close', code => log.debug(`Laravel server exited with code ${code}`)) | ||
laravel.stderr.on('data', data => !started && log.debug(data.toString())) | ||
laravel.stdout.on('data', (data) => { | ||
if (started) return | ||
log(data.toString()) | ||
log.info(data.toString()) | ||
@@ -48,0 +48,0 @@ started = true |
{ | ||
"name": "dusk-runner", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Run dusk tests", | ||
@@ -15,4 +15,4 @@ "main": " ", | ||
"cross-spawn": "^5.1.0", | ||
"debug": "^2.6.3" | ||
"debug-logger": "^0.4.1" | ||
} | ||
} |
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
6008
74
+ Addeddebug-logger@^0.4.1
+ Addeddebug-logger@0.4.1(transitive)
- Removeddebug@^2.6.3