Skip to content

Commit

Permalink
test: use rewire to test exhort services
Browse files Browse the repository at this point in the history
Signed-off-by: Ilona Shishov <[email protected]>
  • Loading branch information
IlonaShishov committed Feb 26, 2024
1 parent cd7ed87 commit a6b0e20
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 95 deletions.
177 changes: 92 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"@vscode/test-electron": "^2.3.5",
"babel-plugin-rewire": "^1.2.0",
"chai": "^4.3.10",
"decache": "^4.6.2",
"eslint": "^8.51.0",
Expand All @@ -285,4 +286,4 @@
"path": "^0.12.7",
"vscode-languageclient": "^8.1.0"
}
}
}
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ class Config {
this.triggerRHRepositoryRecommendationNotification = commands.TRIGGER_REDHAT_REPOSITORY_RECOMMENDATION_NOTIFICATION;
this.utmSource = GlobalState.UTM_SOURCE;
this.exhortSnykToken = rhdaConfig.exhortSnykToken;
/* istanbul ignore next */
this.matchManifestVersions = rhdaConfig.matchManifestVersions ? 'true' : 'false';
this.vulnerabilityAlertSeverity = rhdaConfig.vulnerabilityAlertSeverity;
/* istanbul ignore next */
this.rhdaReportFilePath = rhdaConfig.reportFilePath || defaultRhdaReportFilePath;
this.exhortMvnPath = rhdaConfig.mvn.executable.path || this.DEFAULT_MVN_EXECUTABLE;
this.exhortNpmPath = rhdaConfig.npm.executable.path || this.DEFAULT_NPM_EXECUTABLE;
Expand Down
2 changes: 2 additions & 0 deletions src/dependencyReportPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class DependencyReportPanel {
* Creates or shows the webview panel.
*/
public static createOrShowWebviewPanel() {
/* istanbul ignore next */
const column = vscode.window.activeTextEditor
? vscode.window.activeTextEditor.viewColumn
: undefined;
Expand Down Expand Up @@ -113,6 +114,7 @@ export class DependencyReportPanel {
DependencyReportPanel.data = null;
while (this._disposables.length) {
const x = this._disposables.pop();
/* istanbul ignore else */
if (x) {
x.dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion src/exhortServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function tokenValidationService(options, source) {
vscode.window.showWarningMessage(`Failed to validate token. Status: ${tokenValidationStatus}`);
}
} catch (error) {
vscode.window.showErrorMessage(`Failed to validate token, Error: ${error}`);
vscode.window.showErrorMessage(`Failed to validate token, Error: ${error.message}`);
}
}

Expand Down
Loading

0 comments on commit a6b0e20

Please sign in to comment.