Skip to content

Commit

Permalink
Running extension test via Test Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Mar 11, 2024
1 parent e0dc301 commit 777c7cc
Show file tree
Hide file tree
Showing 4 changed files with 487 additions and 54 deletions.
42 changes: 42 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//@ts-check

import { defineConfig } from '@vscode/test-cli';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

async function generateConfig() {
/** @type {import('@vscode/test-cli').TestConfiguration} */
let config = {
label: 'Extension Test',
files: ['out/**/*.vscode.test.js', 'out/**/*.vscode.common.test.js'],
version: 'insiders',
srcDir: 'src',
workspaceFolder: `${__dirname}/src/test/datascience`,
launchArgs: ['--enable-proposed-api'],
env: {
VSC_JUPYTER_FORCE_LOGGING: '1',
CI_PYTHON_PATH: '', // Update with path to real python interpereter used for testing.
XVSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE: '1',
XVSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE_HTML: '1', //Enable to get full coverage repor (in coverage folder).
VSC_JUPYTER_EXPOSE_SVC: '1'
}
// can not use Insiders if it's already running ;(
// useInstallation: {
// fromMachine: true
// }
};

config.mocha = {
ui: 'tdd',
color: true,
timeout: 25000,
preload: `${__dirname}/out/platform/ioc/reflectMetadata.js`
};

return config;
}

export default defineConfig(generateConfig());
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"mochaExplorer.files": "./out/test/**/*.unit.test.js",
"mochaExplorer.configFile": "./build/.mocha.unittests.js.json",
"mochaExplorer.ui": "tdd",
"mochaExplorer.nodeArgv": ["--enable-source-maps"]
"mochaExplorer.nodeArgv": ["--enable-source-maps"],
"testExplorer.useNativeTesting": true
}
Loading

0 comments on commit 777c7cc

Please sign in to comment.