Skip to content

Commit

Permalink
issue-973: Provide warning for supported version of NodeJS in console…
Browse files Browse the repository at this point in the history
… log

Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Oct 16, 2023
1 parent 051afe3 commit 0b12176
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.15.x
node-version: 18
cache: npm

- name: Run Tests (macOS, windows)
Expand Down
14 changes: 14 additions & 0 deletions src/extester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const DEFAULT_SETUP_OPTIONS = {
export const VSCODE_VERSION_MIN = '1.81.1';
export const VSCODE_VERSION_MAX = '1.83.1';

/**
* The latest version of NodeJS which is properly working with selenium-webdriver
* (for more details, see https://www.npmjs.com/package/selenium-webdriver?activeTab=readme#node-support-policy)
*/
export const NODEJS_VERSION_MAX = '18.15.0';

/**
* VSCode Extension Tester
*/
Expand All @@ -39,6 +45,14 @@ export class ExTester {
constructor(storageFolder: string = 'test-resources', releaseType: ReleaseQuality = ReleaseQuality.Stable, extensionsDir?: string) {
this.code = new CodeUtil(storageFolder, releaseType, extensionsDir);
this.chrome = new DriverUtil(storageFolder);

if (process.versions.node > NODEJS_VERSION_MAX) {
console.log('\x1b[31m%s\x1b[0m', `
ERROR: You are using the unsupported NodeJS version '${process.versions.node}'. The latest supported version is '${NODEJS_VERSION_MAX}'.
We recommend to use supported version to have vscode-extension-tester working properly.
More info at https://github.com/redhat-developer/vscode-extension-tester/issues/975
`);
}
}

/**
Expand Down

0 comments on commit 0b12176

Please sign in to comment.