Skip to content

Commit

Permalink
fix(logging): log non-existing node_modules on debug (#3521)
Browse files Browse the repository at this point in the history
Log missing node_modules for symlinking as 'debug' rather than 'warning'.

When running Stryker in a child directory of a mono-repo, which doesn't have a node_modules directory, Stryker would log a warning. This is far too aggressive.
  • Loading branch information
nicojs authored May 27, 2022
1 parent dab4eb2 commit 766072f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/sandbox/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class Sandbox implements Disposable {
});
}
} else {
this.log.warn(`Could not find a node_modules folder to symlink into the sandbox directory. Search "${basePath}" and its parent directories`);
this.log.debug(`Could not find a node_modules folder to symlink into the sandbox directory. Search "${basePath}" and its parent directories`);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/unit/sandbox/sandbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ describe(Sandbox.name, () => {
);
});

it('should not symlink node modules in sandbox directory if no node_modules exist', async () => {
it('should not symlink node_modules in sandbox directory if no node_modules exist', async () => {
findNodeModulesListStub.resolves([]);
const sut = createSut();
await sut.init();
expect(testInjector.logger.warn).calledWithMatch('Could not find a node_modules');
expect(testInjector.logger.warn).calledWithMatch(process.cwd());
expect(testInjector.logger.debug).calledWithMatch('Could not find a node_modules');
expect(testInjector.logger.debug).calledWithMatch(process.cwd());
expect(symlinkJunctionStub).not.called;
});

Expand Down

0 comments on commit 766072f

Please sign in to comment.