This commit is contained in:
2023-06-08 21:16:38 -07:00
parent d1e8f544c7
commit 0c0b5262bf
20 changed files with 7927 additions and 8886 deletions

View File

@ -1,6 +1,6 @@
import * as path from 'path';
import { runTests } from 'vscode-test';
import { runTests } from '@vscode/test-electron';
async function main() {
try {
@ -15,7 +15,7 @@ async function main() {
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
console.error('Failed to run tests', err);
process.exit(1);
}
}

View File

@ -3,13 +3,13 @@ import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../extension';
// import * as myExtension from '../../extension';
suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('Sample test', () => {
assert.equal(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0));
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
});
});

View File

@ -6,8 +6,8 @@ export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
color: true
});
mocha.useColors(true);
const testsRoot = path.resolve(__dirname, '..');
@ -30,6 +30,7 @@ export function run(): Promise<void> {
}
});
} catch (err) {
console.error(err);
e(err);
}
});