From 1b276dcafb8b0d0d90caa1353c918ce9bee84f2a Mon Sep 17 00:00:00 2001 From: Dominik Jelinek Date: Mon, 16 Oct 2023 12:52:43 +0200 Subject: [PATCH] issue-973: Provide warning for supported version of NodeJS in console log Signed-off-by: Dominik Jelinek --- .github/workflows/main.yml | 2 +- src/extester.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e02848b1..1f5dad65e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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) diff --git a/src/extester.ts b/src/extester.ts index 39dd4128b..033eb782c 100644 --- a/src/extester.ts +++ b/src/extester.ts @@ -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 */ @@ -39,6 +45,13 @@ 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(` + 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. + `); + } } /**