Skip to content

Commit

Permalink
fix(doctor): skip validate config check for running instances (#623)
Browse files Browse the repository at this point in the history
no issue

- skips the validate config check when the tested instance is currently running, as it would fail for testing the server port
  • Loading branch information
aileen authored and acburdine committed Feb 6, 2018
1 parent 324a080 commit a94a987
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/commands/doctor/checks/validate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ function validateConfig(ctx) {
module.exports = {
title: taskTitle,
task: validateConfig,
skip: (ctx) => ctx.instance && ctx.instance.process.isRunning(ctx.instance.dir),
category: ['start']
}
5 changes: 5 additions & 0 deletions test/unit/commands/doctor/checks/validate-config-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ describe('Unit: Doctor Checks > validateConfig', function () {
}
});

it('skips check, when instance is currently running', function () {
const isRunningStub = sinon.stub().returns(true);
expect(validateConfig.skip({instance: {process: {isRunning: isRunningStub}}}), 'true if current instance is running').to.be.true;
});

it('rejects if environment is passed and no config exists for that environment', function () {
env = setupEnv();
const cwdStub = sandbox.stub(process, 'cwd').returns(env.dir);
Expand Down
1 change: 0 additions & 1 deletion test/unit/utils/resolve-version-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('Unit: resolveVersion', function () {
});
});


it('rejects if no versions are found', function () {
stubYarn('{"data": []}');

Expand Down

0 comments on commit a94a987

Please sign in to comment.