Skip to content

Commit 71c2142

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 71c2142

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ function validateConfig(ctx) {
4949
module.exports = {
5050
title: taskTitle,
5151
task: validateConfig,
52+
skip: (ctx) => ctx.instance && ctx.instance.process.isRunning(ctx.instance.dir),
5253
category: ['start']
5354
}

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

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ 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+
expect(validateConfig.skip({instance: {process: {isRunning: isRunningStub}}}), 'true if current instance is running').to.be.true;
27+
});
28+
2429
it('rejects if environment is passed and no config exists for that environment', function () {
2530
env = setupEnv();
2631
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)