diff --git a/package-lock.json b/package-lock.json index c42f2a938..0354a1d3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ ], "dependencies": { "@types/selenium-webdriver": "^4.1.21", + "@types/targz": "^1.0.4", "@vscode/vsce": "^2.23.0", "commander": "^12.0.0", "compare-versions": "^6.1.0", @@ -234,6 +235,31 @@ "@types/ws": "*" } }, + "node_modules/@types/tar-fs": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/tar-fs/-/tar-fs-2.0.4.tgz", + "integrity": "sha512-ipPec0CjTmVDWE+QKr9cTmIIoTl7dFG/yARCM5MqK8i6CNLIG1P8x4kwDsOQY1ChZOZjH0wO9nvfgBvWl4R3kA==", + "dependencies": { + "@types/node": "*", + "@types/tar-stream": "*" + } + }, + "node_modules/@types/tar-stream": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/tar-stream/-/tar-stream-3.1.3.tgz", + "integrity": "sha512-Zbnx4wpkWBMBSu5CytMbrT5ZpMiF55qgM+EpHzR4yIDu7mv52cej8hTkOc6K+LzpkOAbxwn/m7j3iO+/l42YkQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/targz": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/targz/-/targz-1.0.4.tgz", + "integrity": "sha512-4i2weIjweWsnrvutLH7dM/+FPVSFSqxb+XKWo61tAiHxyYYHveImqys5JijMboKJz+jhFu24SlFrdVAB0xAMIw==", + "dependencies": { + "@types/tar-fs": "*" + } + }, "node_modules/@types/unzipper": { "version": "0.10.9", "resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.9.tgz", diff --git a/package.json b/package.json index 37288dbcd..de5c64007 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ }, "dependencies": { "@types/selenium-webdriver": "^4.1.21", + "@types/targz": "^1.0.4", "@vscode/vsce": "^2.23.0", "commander": "^12.0.0", "compare-versions": "^6.1.0", diff --git a/page-objects/src/locators/loader.ts b/page-objects/src/locators/loader.ts index 4c3bb825a..8cfe9761f 100644 --- a/page-objects/src/locators/loader.ts +++ b/page-objects/src/locators/loader.ts @@ -3,7 +3,7 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import { compareVersions } from 'compare-versions'; import { Merge, DeepPartial, DeepRequired } from 'ts-essentials'; -import clone = require('clone-deep'); +import clone from 'clone-deep'; /** * Utility for loading locators for a given vscode version diff --git a/sample-projects/helloworld-sample/src/ui-test/bottomBar-test.ts b/sample-projects/helloworld-sample/src/ui-test/bottomBar-test.ts index 82a034bc8..b4f552552 100644 --- a/sample-projects/helloworld-sample/src/ui-test/bottomBar-test.ts +++ b/sample-projects/helloworld-sample/src/ui-test/bottomBar-test.ts @@ -121,6 +121,7 @@ describe('Bottom Bar Example Tests', function () { let view: OutputView; before(async function () { + this.timeout(30_000); // open the output view first view = await bottomBar.openOutputView(); diff --git a/sample-projects/helloworld-sample/src/ui-test/extensionsView-test.ts b/sample-projects/helloworld-sample/src/ui-test/extensionsView-test.ts index 27eaf6dd9..d451c4b8c 100644 --- a/sample-projects/helloworld-sample/src/ui-test/extensionsView-test.ts +++ b/sample-projects/helloworld-sample/src/ui-test/extensionsView-test.ts @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { ActivityBar, ExtensionsViewItem, ExtensionsViewSection } from 'vscode-extension-tester'; -const pjson = require('../../package.json'); - +import pjson from '../../package.json'; // sample test code on how to look for an extension describe('Example extension view tests', () => { diff --git a/sample-projects/helloworld-sample/tsconfig.json b/sample-projects/helloworld-sample/tsconfig.json index c1ab5b5f4..bbf7f2d29 100644 --- a/sample-projects/helloworld-sample/tsconfig.json +++ b/sample-projects/helloworld-sample/tsconfig.json @@ -1,11 +1,12 @@ { "compilerOptions": { - "module": "commonjs", + "module": "Node16", "target": "es6", "outDir": "out", "sourceMap": true, "strict": true, - "rootDir": "src" + "rootDir": "src", + "resolveJsonModule": true, }, "exclude": [ "node_modules", ".vscode-test", "test-resources", "src/ui-test/resources/**", ".test-extensions" ] } diff --git a/src/cli.ts b/src/cli.ts index eb69cc395..94cb58229 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -3,7 +3,7 @@ import { program } from 'commander'; import { ExTester } from './extester'; import { ReleaseQuality } from './util/codeUtil'; -const pjson = require('../package.json'); +import pjson from '../package.json'; program.version(pjson.version) .description('UI Test Runner for VS Code Extension'); diff --git a/src/suite/runner.ts b/src/suite/runner.ts index c36a93bcf..f39ff1300 100644 --- a/src/suite/runner.ts +++ b/src/suite/runner.ts @@ -2,7 +2,7 @@ import { VSBrowser } from '../browser'; import * as fs from 'fs-extra'; -import Mocha = require('mocha'); +import Mocha from 'mocha'; import { globSync } from 'glob'; import { CodeUtil, ReleaseQuality } from '../util/codeUtil'; import * as path from 'path'; diff --git a/src/util/download.ts b/src/util/download.ts index d0eb5665d..2144e5190 100644 --- a/src/util/download.ts +++ b/src/util/download.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import { promisify } from 'util'; -import stream = require('stream'); +import stream from 'stream'; import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent'; const httpProxyAgent = !process.env.HTTP_PROXY ? undefined : new HttpProxyAgent({ diff --git a/src/util/unpack.ts b/src/util/unpack.ts index 0842ea51f..838a1a907 100644 --- a/src/util/unpack.ts +++ b/src/util/unpack.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; import { exec } from 'child_process'; -const targz = require('targz'); +import targz from 'targz'; import * as unzipper from 'unzipper'; export class Unpack { @@ -8,9 +8,9 @@ export class Unpack { return new Promise((resolve, reject) => { if (input.toString().endsWith('.tar.gz')) { targz.decompress({ - src: input, - dest: target - }, (err: Error) => { + src: input.toString(), + dest: target.toString() + }, (err: string | Error | null) => { err ? reject(err) : resolve(); }); }