Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
EN-744: Move sonarqube bit into dedicated test
Browse files Browse the repository at this point in the history
  • Loading branch information
zenetmi committed Dec 16, 2021
1 parent d5a4add commit 18ea8e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/sonarqube/sonarqube-collector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ describe('SonarqubeCollector', () => {
expect(collector.parseResults).toHaveBeenCalledTimes(1);
expect(collector.parseResults).toHaveBeenCalledWith('"TEST_OUTPUT"');

});

it('should error when arguments fail', async () => {
collector._argv = {
'proj-dir': 'TEST_PROJECT_DIR',
} as any;
process.env.SQ_KEY = 'TEST_PROJECT_KEY';
process.env.SQ_LOGIN = 'TEST_SQ_LOGIN';
process.env.SQ_USERNAME = 'TEST_SQ_USERNAME';
process.env.SQ_PASSWORD = 'TEST_SQ_PASSWORD';

(collector.spawn as any).and.returnValue(new Promise((resolve, reject) => {
reject('TEST_OUTPUT');
}));
Expand Down

0 comments on commit 18ea8e8

Please sign in to comment.