diff --git a/test/functional/lib/environment.js b/test/functional/lib/environment.js index dc958710b..0dc3dd4e6 100644 --- a/test/functional/lib/environment.js +++ b/test/functional/lib/environment.js @@ -29,7 +29,7 @@ class FunctionalEnvironment extends NodeEnvironment { async setup() { const SILENCE_LOG = !process.env.VERDACCIO_DEBUG; // $FlowFixMe - const DEBUG_INJECT: boolean = process.env.VERDACCIO_DEBUG ? process.env.VERDACCIO_DEBUG : false; + const DEBUG_INJECT: boolean = process.env.VERDACCIO_DEBUG_INJECT ? process.env.VERDACCIO_DEBUG_INJECT : false; const forkList = []; const serverList = []; const pathStore = path.join(__dirname, '../store'); diff --git a/test/lib/server_process.js b/test/lib/server_process.js index 432dfca88..ecb159208 100644 --- a/test/lib/server_process.js +++ b/test/lib/server_process.js @@ -4,6 +4,7 @@ import rimRaf from 'rimraf'; import path from 'path'; import {fork} from 'child_process'; import type {IVerdaccioConfig, IServerBridge, IServerProcess} from '../types'; +import {CREDENTIALS} from '../functional/config.func'; export default class VerdaccioProcess implements IServerProcess { @@ -34,8 +35,10 @@ export default class VerdaccioProcess implements IServerProcess { }; if (this.isDebug) { + const debugPort = parseInt(this.config.port, 10) + 5; + childOptions = Object.assign({}, childOptions, { - execArgv: [`--inspect=${this.config.port + 5}`] + execArgv: [`--inspect=${debugPort}`] }); } @@ -44,9 +47,9 @@ export default class VerdaccioProcess implements IServerProcess { this.childFork.on('message', (msg) => { if ('verdaccio_started' in msg) { this.bridge.debug().status(200).then((body) => { - this.bridge.auth('test', 'test') + this.bridge.auth(CREDENTIALS.user, CREDENTIALS.password) .status(201) - .body_ok(/'test'/) + .body_ok(new RegExp(CREDENTIALS.user)) .then(() => { resolve([this, body.pid]); }, reject) @@ -55,6 +58,7 @@ export default class VerdaccioProcess implements IServerProcess { }); this.childFork.on('error', (err) => { + console.log('error process', err); reject([err, this]); });