From e9166375289c451dd1c1c82cd3fef766857a0c52 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 1 Mar 2021 15:10:08 +0100 Subject: [PATCH] tests - enable color output for integration tests --- extensions/emmet/src/test/index.ts | 33 +------------------ extensions/git/src/test/index.ts | 2 +- .../src/test/index.ts | 2 +- .../src/test-all.ts | 2 +- .../src/test/index.ts | 2 +- .../src/test/smoke/index.ts | 2 +- .../src/test/unit/index.ts | 2 +- .../src/singlefolder-tests/index.ts | 2 +- .../src/workspace-tests/index.ts | 2 +- extensions/vscode-colorize-tests/src/index.ts | 2 +- .../src/test/index.ts | 2 +- extensions/vscode-notebook-tests/src/index.ts | 2 +- test/integration/electron/testrunner.js | 2 +- 13 files changed, 13 insertions(+), 44 deletions(-) diff --git a/extensions/emmet/src/test/index.ts b/extensions/emmet/src/test/index.ts index 7d5667439cb..cf92c7a6c3f 100644 --- a/extensions/emmet/src/test/index.ts +++ b/extensions/emmet/src/test/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; @@ -38,34 +38,3 @@ if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { testRunner.configure(options); export = testRunner; - -// import * as path from 'path'; -// import * as Mocha from 'mocha'; -// import * as glob from 'glob'; - -// export function run(testsRoot: string, cb: (error: any, failures?: number) => void): void { -// // Create the mocha test -// const mocha = new Mocha({ -// ui: 'tdd' -// }); -// mocha.useColors(true); - -// glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { -// if (err) { -// return cb(err); -// } - -// // Add files to the test suite -// files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - -// try { -// // Run the mocha test -// mocha.run(failures => { -// cb(null, failures); -// }); -// } catch (err) { -// console.error(err); -// cb(err); -// } -// }); -// } diff --git a/extensions/git/src/test/index.ts b/extensions/git/src/test/index.ts index 819850af768..3fe682fc27f 100644 --- a/extensions/git/src/test/index.ts +++ b/extensions/git/src/test/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/extensions/markdown-language-features/src/test/index.ts b/extensions/markdown-language-features/src/test/index.ts index 56ba0dde4b6..4589f10f8d9 100644 --- a/extensions/markdown-language-features/src/test/index.ts +++ b/extensions/markdown-language-features/src/test/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/extensions/typescript-language-features/src/test-all.ts b/extensions/typescript-language-features/src/test-all.ts index 0057b8aa4a8..ef6cc04ce70 100644 --- a/extensions/typescript-language-features/src/test-all.ts +++ b/extensions/typescript-language-features/src/test-all.ts @@ -21,7 +21,7 @@ const testRunner = require('../../../test/integration/electron/testrunner'); // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) timeout: 60000, }); diff --git a/extensions/typescript-language-features/src/test/index.ts b/extensions/typescript-language-features/src/test/index.ts index 6ddff532d24..11204e863b4 100644 --- a/extensions/typescript-language-features/src/test/index.ts +++ b/extensions/typescript-language-features/src/test/index.ts @@ -21,7 +21,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) timeout: 60000, }); diff --git a/extensions/typescript-language-features/src/test/smoke/index.ts b/extensions/typescript-language-features/src/test/smoke/index.ts index 7c6b176189c..ab3d87566e5 100644 --- a/extensions/typescript-language-features/src/test/smoke/index.ts +++ b/extensions/typescript-language-features/src/test/smoke/index.ts @@ -21,7 +21,7 @@ const testRunner = require('../../../../../test/integration/electron/testrunner' // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) timeout: 60000, }); diff --git a/extensions/typescript-language-features/src/test/unit/index.ts b/extensions/typescript-language-features/src/test/unit/index.ts index 7c6b176189c..ab3d87566e5 100644 --- a/extensions/typescript-language-features/src/test/unit/index.ts +++ b/extensions/typescript-language-features/src/test/unit/index.ts @@ -21,7 +21,7 @@ const testRunner = require('../../../../../test/integration/electron/testrunner' // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle) timeout: 60000, }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/index.ts b/extensions/vscode-api-tests/src/singlefolder-tests/index.ts index 8e0c944f8b2..2b283c396be 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/index.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/extensions/vscode-api-tests/src/workspace-tests/index.ts b/extensions/vscode-api-tests/src/workspace-tests/index.ts index f636d2fd70b..ba41f64f480 100644 --- a/extensions/vscode-api-tests/src/workspace-tests/index.ts +++ b/extensions/vscode-api-tests/src/workspace-tests/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/extensions/vscode-colorize-tests/src/index.ts b/extensions/vscode-colorize-tests/src/index.ts index a6e6e6818f2..f8066005703 100644 --- a/extensions/vscode-colorize-tests/src/index.ts +++ b/extensions/vscode-colorize-tests/src/index.ts @@ -10,7 +10,7 @@ const suite = 'Integration Colorize Tests'; const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/extensions/vscode-custom-editor-tests/src/test/index.ts b/extensions/vscode-custom-editor-tests/src/test/index.ts index c5a810981f8..e37bf5bed83 100644 --- a/extensions/vscode-custom-editor-tests/src/test/index.ts +++ b/extensions/vscode-custom-editor-tests/src/test/index.ts @@ -10,7 +10,7 @@ const suite = 'Custom Editor Tests'; const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 6000000 }; diff --git a/extensions/vscode-notebook-tests/src/index.ts b/extensions/vscode-notebook-tests/src/index.ts index 27c81a57fb1..c6aec5845fc 100644 --- a/extensions/vscode-notebook-tests/src/index.ts +++ b/extensions/vscode-notebook-tests/src/index.ts @@ -8,7 +8,7 @@ const testRunner = require('../../../test/integration/electron/testrunner'); const options: any = { ui: 'tdd', - useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), + color: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), timeout: 60000 }; diff --git a/test/integration/electron/testrunner.js b/test/integration/electron/testrunner.js index 47007fe8002..8a64744321b 100644 --- a/test/integration/electron/testrunner.js +++ b/test/integration/electron/testrunner.js @@ -17,7 +17,7 @@ const Mocha = require('mocha'); let mocha = new Mocha({ ui: 'tdd', - useColors: true + color: true }); exports.configure = function configure(opts) {