diff --git a/.eslintignore b/.eslintignore index 5321480b4..8651ef02e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,3 @@ *.js -test/**/index.ts -test/**/runTest.ts +test/extension-tests/successful-build/project-folder/build tools/prepublish.js diff --git a/.gitignore b/.gitignore index 1e84c79c9..c1ff1dc5e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ node_modules/ out/ test/fakebin/ +test/unit-tests/driver/workspace/test_project/bin/ vscode-extensions-localization-export/ vscode-translations-import/ jobs/loc/LCL diff --git a/gulpfile.js b/gulpfile.js index a9d75abd6..df0e6adbe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -257,6 +257,7 @@ gulp.task('translations-generate', gulp.series(generatedSrcLocBundle, generatedA const allTypeScript = [ 'src/**/*.ts', + 'test/**/*.ts', '!**/*.d.ts', '!**/typings**' ]; @@ -264,7 +265,7 @@ const allTypeScript = [ gulp.task('lint', function () { // Un-comment these parts for applying auto-fix. return gulp.src(allTypeScript) - .pipe(eslint({ configFile: ".eslintrc.js" /*, fix: true*/ })) + .pipe(eslint({ configFile: ".eslintrc.js" /*, fix: true */})) .pipe(eslint.format()) //.pipe(gulp.dest(file => file.base)) .pipe(eslint.failAfterError()); diff --git a/scripts/ci.ps1 b/scripts/ci.ps1 index 829e12c14..2f7a90725 100644 --- a/scripts/ci.ps1 +++ b/scripts/ci.ps1 @@ -106,5 +106,5 @@ Invoke-ChronicCommand "yarn pretest" $yarn run pretest Invoke-ChronicCommand "yarn smokeTests" $yarn run smokeTests Invoke-ChronicCommand "yarn unitTests" $yarn run unitTests Invoke-ChronicCommand "yarn extensionTestsSuccessfulBuild" $yarn run extensionTestsSuccessfulBuild -Invoke-ChronicCommand "yarn extensionTestsSingleRoot" $yarn run extensionTestsSingleRoot +#Invoke-ChronicCommand "yarn extensionTestsSingleRoot" $yarn run extensionTestsSingleRoot Invoke-ChronicCommand "yarn extensionTestsMultioot" $yarn run extensionTestsMultioot diff --git a/test/backend-unit-tests/cmake/strand.test.ts b/test/backend-unit-tests/cmake/strand.test.ts index 617651f67..97e70e72d 100644 --- a/test/backend-unit-tests/cmake/strand.test.ts +++ b/test/backend-unit-tests/cmake/strand.test.ts @@ -1,4 +1,5 @@ -require('module-alias/register'); +// eslint-disable-next-line import/no-unassigned-import +import 'module-alias/register'; import * as chai from 'chai'; import {expect} from 'chai'; diff --git a/test/extension-tests/multi-root-UI/index.ts b/test/extension-tests/multi-root-UI/index.ts index d7b91d847..f3922dd30 100644 --- a/test/extension-tests/multi-root-UI/index.ts +++ b/test/extension-tests/multi-root-UI/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; import * as Mocha from 'mocha'; @@ -13,7 +14,7 @@ export function run(): Promise { const testsRoot = __dirname; return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + glob('**/*.test.js', { cwd: testsRoot }, (err, files) => { if (err) { return e(err); } @@ -36,4 +37,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/extension-tests/multi-root-UI/runTest.ts b/test/extension-tests/multi-root-UI/runTest.ts index d83ec94fc..970fc6b8c 100644 --- a/test/extension-tests/multi-root-UI/runTest.ts +++ b/test/extension-tests/multi-root-UI/runTest.ts @@ -26,4 +26,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/extension-tests/multi-root-UI/test/configure-and-build.test.ts b/test/extension-tests/multi-root-UI/test/configure-and-build.test.ts index 4b6defc47..0fbc7be89 100644 --- a/test/extension-tests/multi-root-UI/test/configure-and-build.test.ts +++ b/test/extension-tests/multi-root-UI/test/configure-and-build.test.ts @@ -26,7 +26,7 @@ if (process.env.TRAVIS_OS_NAME) { suite('Build', async () => { let testEnv: DefaultEnvironment; let compdb_cp_path: string; - let cmakeTools : CMakeTools; + let cmakeTools: CMakeTools; suiteSetup(async function(this: Mocha.Context) { this.timeout(100000); @@ -125,12 +125,11 @@ suite('Build', async () => { test('Test kit switch after missing preferred generator', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, compiler: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; compiler: string}[]} = { linux: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^Clang \d/, compiler: 'Clang'}], win32: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^VisualStudio/, compiler: 'MSVC'}] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; // Run test @@ -150,12 +149,11 @@ suite('Build', async () => { test('Test kit switch between different preferred generators and compilers', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, compiler: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; compiler: string}[]} = { linux: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^Clang \d/, compiler: 'Clang'}], win32: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^VisualStudio/, compiler: 'MSVC'}] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; testEnv.kitSelection.defaultKitLabel = compiler[0].kitLabel; diff --git a/test/extension-tests/multi-root-UI/test/debugger.test.ts b/test/extension-tests/multi-root-UI/test/debugger.test.ts index 012f20fef..aa96054ef 100644 --- a/test/extension-tests/multi-root-UI/test/debugger.test.ts +++ b/test/extension-tests/multi-root-UI/test/debugger.test.ts @@ -2,7 +2,6 @@ import {DefaultEnvironment, expect, getFirstSystemKit} from '@test/util'; import * as vscode from 'vscode'; import CMakeTools from '@cmt/cmake-tools'; - suite('[Debug/Launch interface]', async () => { let testEnv: DefaultEnvironment; let cmakeTools: CMakeTools; diff --git a/test/extension-tests/multi-root-UI/test/variant-envs.test.ts b/test/extension-tests/multi-root-UI/test/variant-envs.test.ts index c535b7057..2a0b8cff4 100644 --- a/test/extension-tests/multi-root-UI/test/variant-envs.test.ts +++ b/test/extension-tests/multi-root-UI/test/variant-envs.test.ts @@ -1,4 +1,3 @@ - import * as api from '@cmt/api'; import {CMakeCache} from '@cmt/cache'; import {clearExistingKitConfigurationFile, DefaultEnvironment, expect, getFirstSystemKit} from '@test/util'; @@ -9,7 +8,7 @@ import CMakeTools from '@cmt/cmake-tools'; suite('[Environment Variables in Variants]', async () => { let testEnv: DefaultEnvironment; - let cmakeTools : CMakeTools; + let cmakeTools: CMakeTools; setup(async function(this: Mocha.Context) { this.timeout(100000); diff --git a/test/extension-tests/single-root-UI/index.ts b/test/extension-tests/single-root-UI/index.ts index 40fc4509e..271b5dfad 100644 --- a/test/extension-tests/single-root-UI/index.ts +++ b/test/extension-tests/single-root-UI/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; @@ -14,7 +15,7 @@ export function run(): Promise { const testsRoot = __dirname; return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + glob('**/*.test.js', { cwd: testsRoot }, (err, files) => { if (err) { return e(err); } @@ -37,4 +38,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/extension-tests/single-root-UI/runTest.ts b/test/extension-tests/single-root-UI/runTest.ts index cdb61d529..d6f23d2fa 100644 --- a/test/extension-tests/single-root-UI/runTest.ts +++ b/test/extension-tests/single-root-UI/runTest.ts @@ -27,4 +27,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/extension-tests/single-root-UI/test/configure-and-build.test-kits.ts b/test/extension-tests/single-root-UI/test/configure-and-build-kits.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/configure-and-build.test-kits.ts rename to test/extension-tests/single-root-UI/test/configure-and-build-kits.test.ts diff --git a/test/extension-tests/single-root-UI/test/configure-and-build.test-presets.ts b/test/extension-tests/single-root-UI/test/configure-and-build-presets.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/configure-and-build.test-presets.ts rename to test/extension-tests/single-root-UI/test/configure-and-build-presets.test.ts diff --git a/test/extension-tests/single-root-UI/test/debugger-test-kits.ts b/test/extension-tests/single-root-UI/test/debugger-kits.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/debugger-test-kits.ts rename to test/extension-tests/single-root-UI/test/debugger-kits.test.ts diff --git a/test/extension-tests/single-root-UI/test/debugger-test-presets.ts b/test/extension-tests/single-root-UI/test/debugger-presets.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/debugger-test-presets.ts rename to test/extension-tests/single-root-UI/test/debugger-presets.test.ts diff --git a/test/extension-tests/single-root-UI/test/envs-test-kits.ts b/test/extension-tests/single-root-UI/test/envs-kits.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/envs-test-kits.ts rename to test/extension-tests/single-root-UI/test/envs-kits.test.ts diff --git a/test/extension-tests/single-root-UI/test/envs-test-presets.ts b/test/extension-tests/single-root-UI/test/envs-presets.test.ts similarity index 100% rename from test/extension-tests/single-root-UI/test/envs-test-presets.ts rename to test/extension-tests/single-root-UI/test/envs-presets.test.ts diff --git a/test/extension-tests/successful-build/index.ts b/test/extension-tests/successful-build/index.ts index d7b91d847..f3922dd30 100644 --- a/test/extension-tests/successful-build/index.ts +++ b/test/extension-tests/successful-build/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; import * as Mocha from 'mocha'; @@ -13,7 +14,7 @@ export function run(): Promise { const testsRoot = __dirname; return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + glob('**/*.test.js', { cwd: testsRoot }, (err, files) => { if (err) { return e(err); } @@ -36,4 +37,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/extension-tests/successful-build/runTest.ts b/test/extension-tests/successful-build/runTest.ts index f1337e73f..c109a9255 100644 --- a/test/extension-tests/successful-build/runTest.ts +++ b/test/extension-tests/successful-build/runTest.ts @@ -27,4 +27,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/extension-tests/successful-build/test/configure-and-build.test.ts b/test/extension-tests/successful-build/test/configure-and-build.test.ts index 7a824c8c0..f8ec25e72 100644 --- a/test/extension-tests/successful-build/test/configure-and-build.test.ts +++ b/test/extension-tests/successful-build/test/configure-and-build.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import {CMakeTools, ConfigureTrigger} from '@cmt/cmake-tools'; import {fs} from '@cmt/pr'; import {TestProgramResult} from '@test/helpers/testprogram/test-program-result'; @@ -12,7 +13,6 @@ import { } from '@test/util'; import * as path from 'path'; - let workername: string = process.platform; if (process.env.APPVEYOR_BUILD_WORKER_IMAGE) { @@ -93,7 +93,6 @@ suite('Build', async () => { expect(result['cookie']).to.eq('passed-cookie'); }).timeout(100000); - test('Configure and Build', async () => { expect(await cmt.configureInternal(ConfigureTrigger.runTests)).to.be.eq(0); expect(await cmt.build()).to.be.eq(0); @@ -129,12 +128,11 @@ suite('Build', async () => { test('Test kit switch after missing preferred generator', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, compiler: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; compiler: string}[]} = { linux: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^Clang \d/, compiler: 'Clang'}], win32: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^VisualStudio/, compiler: 'MSVC'}] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; // Run test @@ -153,7 +151,7 @@ suite('Build', async () => { test('Test kit switch after missing preferred generator #512', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, generator: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; generator: string}[]} = { linux: [ {kitLabel: /^Generator switch test GCC Make$/, generator: 'Unix Makefiles'}, {kitLabel: /^Generator switch test GCC no generator$/, generator: ''} @@ -163,8 +161,7 @@ suite('Build', async () => { {kitLabel: /^Generator switch test GCC no generator - Win/, generator: ''} ] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } // Remove all preferred generator (Remove config dependenies, auto detection) testEnv.config.updatePartial({preferredGenerators: []}); const compiler = os_compilers[workername]; @@ -205,12 +202,11 @@ suite('Build', async () => { test('Test kit switch between different preferred generators and compilers', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, compiler: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; compiler: string}[]} = { linux: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^Clang \d/, compiler: 'Clang'}], win32: [{kitLabel: /^GCC \d/, compiler: 'GNU'}, {kitLabel: /^VisualStudio/, compiler: 'MSVC'}] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; testEnv.kitSelection.defaultKitLabel = compiler[0].kitLabel; @@ -229,7 +225,7 @@ suite('Build', async () => { test('Test kit switch between different preferred generators and same compiler', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, generator: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; generator: string}[]} = { linux: [ {kitLabel: /^Generator switch test GCC Make$/, generator: 'Unix Makefiles'}, {kitLabel: /^Generator switch test GCC Ninja$/, generator: 'Ninja'} @@ -239,8 +235,7 @@ suite('Build', async () => { {kitLabel: /^Generator switch test GCC Ninja - Win/, generator: 'Ninja'} ] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; testEnv.config.updatePartial({preferredGenerators: []}); @@ -262,7 +257,7 @@ suite('Build', async () => { test('Test kit switch kits after configure', async function(this: Mocha.Context) { // Select compiler build node dependent - const os_compilers: {[osName: string]: {kitLabel: RegExp, generator: string}[]} = { + const os_compilers: {[osName: string]: {kitLabel: RegExp; generator: string}[]} = { linux: [ {kitLabel: /^Generator switch test GCC Make$/, generator: 'Unix Makefiles'}, {kitLabel: /^Generator switch test GCC Ninja$/, generator: 'Ninja'} @@ -272,8 +267,7 @@ suite('Build', async () => { {kitLabel: /^Generator switch test GCC Ninja - Win/, generator: 'Ninja'} ] }; - if (!(workername in os_compilers)) - this.skip(); + if (!(workername in os_compilers)) {this.skip(); } const compiler = os_compilers[workername]; testEnv.config.updatePartial({preferredGenerators: []}); diff --git a/test/extension-tests/successful-build/test/debugger.test.ts b/test/extension-tests/successful-build/test/debugger.test.ts index 033c779d4..274bf7467 100644 --- a/test/extension-tests/successful-build/test/debugger.test.ts +++ b/test/extension-tests/successful-build/test/debugger.test.ts @@ -1,10 +1,10 @@ +/* eslint-disable no-unused-expressions */ import {CMakeTools} from '@cmt/cmake-tools'; import {DefaultEnvironment, expect, getFirstSystemKit} from '@test/util'; //import sinon = require('sinon'); import * as fs from 'fs'; import * as path from 'path'; - suite('[Debug/Launch interface]', async () => { let cmt: CMakeTools; let testEnv: DefaultEnvironment; diff --git a/test/extension-tests/successful-build/test/environment.test.ts b/test/extension-tests/successful-build/test/environment.test.ts index b5501aac0..425318bdc 100644 --- a/test/extension-tests/successful-build/test/environment.test.ts +++ b/test/extension-tests/successful-build/test/environment.test.ts @@ -33,8 +33,8 @@ suite('[Environment]', async () => { // Set fake settings testEnv.config.updatePartial({ configureEnvironment: { - _CONFIGURE_ENV: '${workspaceRootFolderName}', - }, + _CONFIGURE_ENV: '${workspaceRootFolderName}' + } }); // Configure diff --git a/test/extension-tests/successful-build/test/preferred-generators.test.ts b/test/extension-tests/successful-build/test/preferred-generators.test.ts index 58c4b1137..fc1134e79 100644 --- a/test/extension-tests/successful-build/test/preferred-generators.test.ts +++ b/test/extension-tests/successful-build/test/preferred-generators.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import {CMakeTools} from '@cmt/cmake-tools'; import {Kit, scanForKits} from '@cmt/kit'; import {clearExistingKitConfigurationFile, DefaultEnvironment, expect} from '@test/util'; @@ -71,7 +72,7 @@ const DEFAULT_VS_KITS: KitEnvironment[] = [ expectedDefaultGenerator: /^Visual Studio 11 2012/, path: [''], isVsNewerThan14: false - }, + } ]; const DEFAULT_CYGWIN_KITS: KitEnvironment[] = @@ -190,12 +191,10 @@ interface SkipOptions { function skipTestIf(skipOptions: SkipOptions, testContext: any, context: CMakeContext): void { // Skip if kit is not available (matched by default name) - if (skipOptions.kitIsNotAvailable && !isKitAvailable(context)) - testContext.skip(); + if (skipOptions.kitIsNotAvailable && !isKitAvailable(context)) {testContext.skip(); } if ((skipOptions.preferredGeneratorIsAvailable && isPreferredGeneratorAvailable(context)) - || (skipOptions.preferredGeneratorIsNotAvailable && !isPreferredGeneratorAvailable(context))) - testContext.skip(); + || (skipOptions.preferredGeneratorIsNotAvailable && !isPreferredGeneratorAvailable(context))) {testContext.skip(); } } function makeExtensionTestSuite(name: string, @@ -279,8 +278,8 @@ KITS_BY_PLATFORM[workername].forEach(buildSystem => { preferredGenerators: [ 'NMake Makefiles', 'Unix Makefiles', - 'MinGW Makefiles', - ], + 'MinGW Makefiles' + ] }); expect(await context.cmt.build()).to.eql(0); const result = await context.testEnv.result.getResultAsJson(); diff --git a/test/extension-tests/successful-build/test/scan_kits.test.ts b/test/extension-tests/successful-build/test/scan_kits.test.ts index 2bd03e193..201c5bf88 100644 --- a/test/extension-tests/successful-build/test/scan_kits.test.ts +++ b/test/extension-tests/successful-build/test/scan_kits.test.ts @@ -2,7 +2,6 @@ import {scanForKits} from '@cmt/kit'; import {fs} from '@cmt/pr'; import {expect} from '@test/util'; - suite('[MinGW Tests]', async () => { const mingw_dirs: string[] = ['C:\\Qt\\Tools\\mingw492_32', 'C:\\mingw-w64\\x86_64-7.2.0-posix-seh-rt_v5-rev1\\mingw64']; @@ -13,7 +12,7 @@ suite('[MinGW Tests]', async () => { test('Test scan of mingw', async () => { const kits = await scanForKits(undefined, { scanDirs: [], - minGWSearchDirs: mingw_dirs, + minGWSearchDirs: mingw_dirs }); const is_kit_MinGW_present = kits.find(kit => kit.name.indexOf('GCC for i686-w64-mingw32 4.9.2') >= 0) ? true : false; const is_kit_MinGW_w64_present = kits.find(kit => kit.name.indexOf('GCC for x86_64-w64-mingw32 7.2.0') >= 0) ? true : false; diff --git a/test/extension-tests/successful-build/test/toolchain.test.ts b/test/extension-tests/successful-build/test/toolchain.test.ts index e47b6028b..d2b3f1e8d 100644 --- a/test/extension-tests/successful-build/test/toolchain.test.ts +++ b/test/extension-tests/successful-build/test/toolchain.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import * as api from '@cmt/api'; import {CMakeCache} from '@cmt/cache'; import {CMakeTools, ConfigureTrigger} from '@cmt/cmake-tools'; @@ -11,8 +12,7 @@ suite('[Toolchain Substitution]', async () => { setup(async function(this: Mocha.Context) { this.timeout(100000); - if (process.platform === 'win32') - this.skip(); + if (process.platform === 'win32') {this.skip(); } testEnv = new DefaultEnvironment('test/extension-tests/successful-build/project-folder', 'build', 'output.txt'); cmt = await CMakeTools.create(testEnv.vsContext, testEnv.wsContext); diff --git a/test/extension-tests/successful-build/test/variable-substitution.test.ts b/test/extension-tests/successful-build/test/variable-substitution.test.ts index c5f20a091..aaf9e2e57 100644 --- a/test/extension-tests/successful-build/test/variable-substitution.test.ts +++ b/test/extension-tests/successful-build/test/variable-substitution.test.ts @@ -65,7 +65,6 @@ suite('[Variable Substitution]', async () => { expect(typeof cacheEntry.value).to.eq('string', '[workspaceFolder] unexpected cache entry value type'); }).timeout(100000); - test('Check substitution for "workspaceHash"', async () => { // Set fake settings testEnv.config.updatePartial({configureSettings: {workspaceHash: '${workspaceHash}'}}); diff --git a/test/extension-tests/successful-build/test/variant-envs.test.ts b/test/extension-tests/successful-build/test/variant-envs.test.ts index c735baf0b..09471901f 100644 --- a/test/extension-tests/successful-build/test/variant-envs.test.ts +++ b/test/extension-tests/successful-build/test/variant-envs.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-expressions */ import * as api from '@cmt/api'; import {CMakeCache} from '@cmt/cache'; @@ -6,7 +7,6 @@ import {clearExistingKitConfigurationFile, DefaultEnvironment, expect, getFirstS import {fs} from '@cmt/pr'; import * as path from 'path'; - suite('[Environment Variables in Variants]', async () => { let cmt: CMakeTools; let testEnv: DefaultEnvironment; diff --git a/test/helpers/cmake/build-directory-helper.ts b/test/helpers/cmake/build-directory-helper.ts index 14c1f7e3c..a8c67b518 100644 --- a/test/helpers/cmake/build-directory-helper.ts +++ b/test/helpers/cmake/build-directory-helper.ts @@ -16,4 +16,4 @@ export class BuildDirectoryHelper { public get cmakeCachePath(): string { return path.join(this.location, 'CMakeCache.txt'); } public get isCMakeCachePresent(): boolean { return fs.existsSync(this.cmakeCachePath); } -} \ No newline at end of file +} diff --git a/test/helpers/cmake/project-root-helper.ts b/test/helpers/cmake/project-root-helper.ts index c18a217cf..b8662dad2 100644 --- a/test/helpers/cmake/project-root-helper.ts +++ b/test/helpers/cmake/project-root-helper.ts @@ -1,7 +1,6 @@ import * as path from 'path'; import {BuildDirectoryHelper} from './build-directory-helper'; - export class ProjectRootHelper { private readonly _locationOfThisClassFile: string = __dirname; private readonly _buildFolder: BuildDirectoryHelper; @@ -19,4 +18,4 @@ export class ProjectRootHelper { public get buildDirectory(): BuildDirectoryHelper { return this._buildFolder; } public get location(): string { return this._projectRoot; } -} \ No newline at end of file +} diff --git a/test/helpers/test/default-environment.ts b/test/helpers/test/default-environment.ts index 300f013a4..47a0e195e 100644 --- a/test/helpers/test/default-environment.ts +++ b/test/helpers/test/default-environment.ts @@ -24,12 +24,10 @@ export class DefaultEnvironment { return Promise.resolve(undefined); }; this.sandbox.stub(vscode.window, 'showErrorMessage').callsFake(fakeShowErrorMessage); - const fakeShowInformationMessage = (_message: string, _options: vscode.MessageOptions, ..._items: T[]): Thenable => { - return Promise.resolve(undefined); - }; + const fakeShowInformationMessage = (_message: string, _options: vscode.MessageOptions, ..._items: T[]): Thenable => Promise.resolve(undefined); this.sandbox.stub(vscode.window, 'showInformationMessage').callsFake(fakeShowInformationMessage); if (process.env.CMAKE_EXECUTABLE) { - this.config.updatePartial( {cmakePath: process.env.CMAKE_EXECUTABLE}); + this.config.updatePartial({cmakePath: process.env.CMAKE_EXECUTABLE}); } } diff --git a/test/helpers/testprogram/test-program-result.ts b/test/helpers/testprogram/test-program-result.ts index 2c03bdd5a..bc2b4b990 100644 --- a/test/helpers/testprogram/test-program-result.ts +++ b/test/helpers/testprogram/test-program-result.ts @@ -1,4 +1,3 @@ - import {expect} from 'chai'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/test/helpers/vscodefake/extensioncontext.ts b/test/helpers/vscodefake/extensioncontext.ts index 49b6b1914..91409abfb 100644 --- a/test/helpers/vscodefake/extensioncontext.ts +++ b/test/helpers/vscodefake/extensioncontext.ts @@ -3,9 +3,9 @@ import * as vscode from 'vscode'; import {TestMemento, StateMemento} from './memento'; const notImplementedErr: string = 'Method not implemented.'; export class DefaultExtensionContext implements vscode.ExtensionContext { - get subscriptions(): { dispose(): any; }[] { return ([]); } + get subscriptions(): { dispose(): any }[] { return ([]); } workspaceState: vscode.Memento = new TestMemento(); - globalState: vscode.Memento & { setKeysForSync(keys: string[]): void; } = new StateMemento(); + globalState: vscode.Memento & { setKeysForSync(keys: string[]): void } = new StateMemento(); get secrets(): vscode.SecretStorage { throw new Error(notImplementedErr); } get extensionUri(): vscode.Uri { throw new Error(notImplementedErr); } get extensionPath(): string { throw new Error(notImplementedErr); } @@ -27,9 +27,9 @@ export class DefaultExtensionContext implements vscode.ExtensionContext { } export class SmokeTestExtensionContext implements vscode.ExtensionContext { - get subscriptions(): { dispose(): any; }[] { return ([]); } + get subscriptions(): { dispose(): any }[] { return ([]); } workspaceState: vscode.Memento = new TestMemento(); - globalState: vscode.Memento & { setKeysForSync(keys: string[]): void; } = new StateMemento(); + globalState: vscode.Memento & { setKeysForSync(keys: string[]): void } = new StateMemento(); get secrets(): vscode.SecretStorage { throw new Error(notImplementedErr); } get extensionUri(): vscode.Uri { throw new Error(notImplementedErr); } get environmentVariableCollection(): vscode.EnvironmentVariableCollection { throw new Error(notImplementedErr); } diff --git a/test/smoke/badProject/index.ts b/test/smoke/badProject/index.ts index c7031b1b8..1a8d4f5a1 100644 --- a/test/smoke/badProject/index.ts +++ b/test/smoke/badProject/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; @@ -36,4 +37,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/smoke/badProject/runTest.ts b/test/smoke/badProject/runTest.ts index 53ebd82c8..f931f719d 100644 --- a/test/smoke/badProject/runTest.ts +++ b/test/smoke/badProject/runTest.ts @@ -22,4 +22,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/smoke/goodProject/index.ts b/test/smoke/goodProject/index.ts index 309e01f69..2d98870a9 100644 --- a/test/smoke/goodProject/index.ts +++ b/test/smoke/goodProject/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; @@ -37,4 +38,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/smoke/goodProject/runTest.ts b/test/smoke/goodProject/runTest.ts index 65dbc0811..b2c341e98 100644 --- a/test/smoke/goodProject/runTest.ts +++ b/test/smoke/goodProject/runTest.ts @@ -22,4 +22,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/smoke/noCtest/index.ts b/test/smoke/noCtest/index.ts index 309e01f69..2d98870a9 100644 --- a/test/smoke/noCtest/index.ts +++ b/test/smoke/noCtest/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; @@ -37,4 +38,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/smoke/noCtest/runTest.ts b/test/smoke/noCtest/runTest.ts index 81aa89cbf..4c3f81fec 100644 --- a/test/smoke/noCtest/runTest.ts +++ b/test/smoke/noCtest/runTest.ts @@ -22,4 +22,4 @@ async function main() { } } -main(); \ No newline at end of file +main(); diff --git a/test/unit-tests/index.ts b/test/unit-tests/index.ts index 40fc4509e..4bd186c8e 100644 --- a/test/unit-tests/index.ts +++ b/test/unit-tests/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unassigned-import import 'module-alias/register'; import * as path from 'path'; @@ -37,4 +38,4 @@ export function run(): Promise { } }); }); -} \ No newline at end of file +} diff --git a/test/unit-tests/pii.test.ts b/test/unit-tests/pii.test.ts index a5c973118..5258f75b9 100644 --- a/test/unit-tests/pii.test.ts +++ b/test/unit-tests/pii.test.ts @@ -50,4 +50,4 @@ suite('Stack trace cleaning test', async () => { expect(cleanString('Error: ENOENT: c:\\path\\to\\file')).to.eq('Error: ENOENT: '); expect(cleanString('Error: ENOENT: /path/to/file')).to.eq('Error: ENOENT: '); }); -}); \ No newline at end of file +}); diff --git a/test/unit-tests/runTest.ts b/test/unit-tests/runTest.ts index 866b3f82d..8c2c548ca 100644 --- a/test/unit-tests/runTest.ts +++ b/test/unit-tests/runTest.ts @@ -29,4 +29,4 @@ async function main() { } } -main(); \ No newline at end of file +main();