Skip to content

Commit

Permalink
fix: Get rid off 'require' when importing dependencies (#1140)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek authored Feb 20, 2024
1 parent 962647e commit f6298da
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 12 deletions.
26 changes: 26 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion page-objects/src/locators/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
5 changes: 3 additions & 2 deletions sample-projects/helloworld-sample/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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" ]
}
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/suite/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/util/download.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
8 changes: 4 additions & 4 deletions src/util/unpack.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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 {
static unpack(input: fs.PathLike, target: fs.PathLike): Promise<void> {
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();
});
}
Expand Down

0 comments on commit f6298da

Please sign in to comment.