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 bad121e
Show file tree
Hide file tree
Showing 3 changed files with 14 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
7 changes: 7 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { WebDriver, Builder, until, initPageObjects, logging, By } from 'monaco-
import { Options, ServiceBuilder } from 'selenium-webdriver/chrome';
import { getLocatorsPath } from 'vscode-extension-tester-locators';
import { CodeUtil, ReleaseQuality } from './util/codeUtil';
import { NODEJS_VERSION_MAX } from './extester';

export class VSBrowser {
static readonly baseVersion = '1.37.0';
Expand Down Expand Up @@ -84,6 +85,12 @@ export class VSBrowser {
prefs.setLevel(logging.Type.DRIVER, this.logLevel);
options.setLoggingPrefs(prefs);

if (process.versions.node > NODEJS_VERSION_MAX) {
console.error(`
WARNING: 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.
`);
}
console.log('Launching browser...');
this._driver = await new Builder()
.setChromeService(new ServiceBuilder(path.join(this.storagePath, process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver')))
Expand Down
6 changes: 6 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 Down

0 comments on commit bad121e

Please sign in to comment.