diff options
author | Johannes <johannes.rieken@gmail.com> | 2022-06-08 18:49:21 +0300 |
---|---|---|
committer | Johannes <johannes.rieken@gmail.com> | 2022-06-08 18:49:21 +0300 |
commit | 0656d21d11910e1b241d7d6c52761d89c0ba23a4 (patch) | |
tree | 1b83157b21fe9f2702fa8a2019d500de57154dcf /test | |
parent | aa23a0dbb749fd3a51a8ed217538c563b8ff012a (diff) |
auto-fixed prefer-const violation
Diffstat (limited to 'test')
-rw-r--r-- | test/automation/src/problems.ts | 4 | ||||
-rw-r--r-- | test/automation/src/terminal.ts | 4 | ||||
-rw-r--r-- | test/integration/browser/src/index.ts | 2 | ||||
-rw-r--r-- | test/unit/browser/index.js | 6 | ||||
-rw-r--r-- | test/unit/coverage.js | 4 | ||||
-rw-r--r-- | test/unit/electron/renderer.js | 4 | ||||
-rw-r--r-- | test/unit/node/index.js | 4 | ||||
-rw-r--r-- | test/unit/reporter.js | 2 |
8 files changed, 15 insertions, 15 deletions
diff --git a/test/automation/src/problems.ts b/test/automation/src/problems.ts index d446ea4630b..0527b50d767 100644 --- a/test/automation/src/problems.ts +++ b/test/automation/src/problems.ts @@ -32,12 +32,12 @@ export class Problems { } static getSelectorInProblemsView(problemType: ProblemSeverity): string { - let selector = problemType === ProblemSeverity.WARNING ? 'codicon-warning' : 'codicon-error'; + const selector = problemType === ProblemSeverity.WARNING ? 'codicon-warning' : 'codicon-error'; return `div[id="workbench.panel.markers"] .monaco-tl-contents .marker-icon.${selector}`; } static getSelectorInEditor(problemType: ProblemSeverity): string { - let selector = problemType === ProblemSeverity.WARNING ? 'squiggly-warning' : 'squiggly-error'; + const selector = problemType === ProblemSeverity.WARNING ? 'squiggly-warning' : 'squiggly-error'; return `.view-overlays .cdr.${selector}`; } } diff --git a/test/automation/src/terminal.ts b/test/automation/src/terminal.ts index 2137c3555ed..1dfeac42aeb 100644 --- a/test/automation/src/terminal.ts +++ b/test/automation/src/terminal.ts @@ -142,11 +142,11 @@ export class Terminal { let index = 0; while (index < expectedCount) { for (let groupIndex = 0; groupIndex < expectedGroups.length; groupIndex++) { - let terminalsInGroup = expectedGroups[groupIndex].length; + const terminalsInGroup = expectedGroups[groupIndex].length; let indexInGroup = 0; const isSplit = terminalsInGroup > 1; while (indexInGroup < terminalsInGroup) { - let instance = expectedGroups[groupIndex][indexInGroup]; + const instance = expectedGroups[groupIndex][indexInGroup]; const nameRegex = instance.name && isSplit ? new RegExp('\\s*[├┌└]\\s*' + instance.name) : instance.name ? new RegExp(/^\s*/ + instance.name) : undefined; await this.assertTabExpected(undefined, index, nameRegex, instance.icon, instance.color, instance.description); indexInGroup++; diff --git a/test/integration/browser/src/index.ts b/test/integration/browser/src/index.ts index 39a996b6ff4..3704e0eb66a 100644 --- a/test/integration/browser/src/index.ts +++ b/test/integration/browser/src/index.ts @@ -149,7 +149,7 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U const stdio: cp.StdioOptions = optimist.argv.debug ? 'pipe' : ['ignore', 'pipe', 'ignore']; - let serverProcess = cp.spawn( + const serverProcess = cp.spawn( serverLocation, serverArgs, { env, stdio } diff --git a/test/unit/browser/index.js b/test/unit/browser/index.js index f8f871d6d3b..cd0682bfb99 100644 --- a/test/unit/browser/index.js +++ b/test/unit/browser/index.js @@ -99,7 +99,7 @@ const testModules = (async function () { return promise.then(files => { const modules = []; - for (let file of files) { + for (const file of files) { if (!minimatch(file, excludeGlob)) { modules.push(file.replace(/\.js$/, '')); @@ -151,7 +151,7 @@ async function runTestsInBrowser(testModules, browserType) { emitter.on('fail', (test, err) => { if (err.stack) { const regex = /(vs\/.*\.test)\.js/; - for (let line of String(err.stack).split('\n')) { + for (const line of String(err.stack).split('\n')) { const match = regex.exec(line); if (match) { fails.push(match[1]); @@ -255,7 +255,7 @@ testModules.then(async modules => { } // aftermath - for (let msg of messages) { + for (const msg of messages) { if (msg) { didFail = true; console.log(msg); diff --git a/test/unit/coverage.js b/test/unit/coverage.js index e93f84c8c4f..49b748e3bf1 100644 --- a/test/unit/coverage.js +++ b/test/unit/coverage.js @@ -37,7 +37,7 @@ exports.createReport = function (isSingle) { const coverageMap = iLibCoverage.createCoverageMap(global.__coverage__); return mapStore.transformCoverage(coverageMap).then((transformed) => { // Paths come out all broken - let newData = Object.create(null); + const newData = Object.create(null); Object.keys(transformed.data).forEach((file) => { const entry = transformed.data[file]; const fixedPath = fixPath(entry.path); @@ -52,7 +52,7 @@ exports.createReport = function (isSingle) { }); const tree = context.getTree('flat'); - let reports = []; + const reports = []; if (isSingle) { reports.push(iReports.create('lcovonly')); } else { diff --git a/test/unit/electron/renderer.js b/test/unit/electron/renderer.js index e30df42b957..6e2979aa8f0 100644 --- a/test/unit/electron/renderer.js +++ b/test/unit/electron/renderer.js @@ -72,12 +72,12 @@ if (util.inspect && util.inspect['defaultOptions']) { util.inspect['defaultOptions'].customInspect = false; } -let _tests_glob = '**/test/**/*.test.js'; +const _tests_glob = '**/test/**/*.test.js'; let loader; let _out; function initLoader(opts) { - let outdir = opts.build ? 'out-build' : 'out'; + const outdir = opts.build ? 'out-build' : 'out'; _out = path.join(__dirname, `../../../${outdir}`); // setup loader diff --git a/test/unit/node/index.js b/test/unit/node/index.js index fd55cea9d93..46176ac3572 100644 --- a/test/unit/node/index.js +++ b/test/unit/node/index.js @@ -152,7 +152,7 @@ function main() { glob(TEST_GLOB, { cwd: src }, function (err, files) { /** @type {string[]} */ const modules = []; - for (let file of files) { + for (const file of files) { if (!excludeGlobs.some(excludeGlob => minimatch(file, excludeGlob))) { modules.push(file.replace(/\.js$/, '')); } @@ -180,7 +180,7 @@ function main() { } // report failing test for every unexpected error during any of the tests - let unexpectedErrors = []; + const unexpectedErrors = []; mocha.suite('Errors', function () { test('should not have unexpected errors in tests', function () { if (unexpectedErrors.length) { diff --git a/test/unit/reporter.js b/test/unit/reporter.js index c2ae6d7954b..25c6e0d5574 100644 --- a/test/unit/reporter.js +++ b/test/unit/reporter.js @@ -8,7 +8,7 @@ const FullJsonStreamReporter = require('./fullJsonStreamReporter'); const path = require('path'); function parseReporterOption(value) { - let r = /^([^=]+)=(.*)$/.exec(value); + const r = /^([^=]+)=(.*)$/.exec(value); return r ? { [r[1]]: r[2] } : {}; } |