Skip to content

Commit 4be4bb6

Browse files
committed
fix(doctor) skip validate config check for running instances
no issue - skips the validate config check when the tested instance is currently running, as it would fail for testing the server port
1 parent 324a080 commit 4be4bb6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/commands/doctor/checks/validate-config.js

+5
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ function validateConfig(ctx) {
4949
module.exports = {
5050
title: taskTitle,
5151
task: validateConfig,
52+
skip: (ctx) => {
53+
const instance = ctx.system.getInstance();
54+
55+
return instance.process.isRunning(instance.dir);
56+
},
5257
category: ['start']
5358
}

test/unit/commands/doctor/checks/validate-config-spec.js

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ describe('Unit: Doctor Checks > validateConfig', function () {
2121
}
2222
});
2323

24+
it('skips check, when instance is currently running', function () {
25+
const isRunningStub = sinon.stub().returns(true);
26+
const getInstanceStub = sinon.stub().returns({process: {isRunning: isRunningStub}});
27+
expect(validateConfig.skip({system: {getInstance: getInstanceStub}}), 'true if current instance is running').to.be.true;
28+
});
29+
2430
it('rejects if environment is passed and no config exists for that environment', function () {
2531
env = setupEnv();
2632
const cwdStub = sandbox.stub(process, 'cwd').returns(env.dir);

test/unit/utils/resolve-version-spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ describe('Unit: resolveVersion', function () {
4646
});
4747
});
4848

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

0 commit comments

Comments
 (0)