Skip to content

Commit 8c9601c

Browse files
committed
work on testing
1 parent 19d1666 commit 8c9601c

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@
1818
"preLaunchTask": "${defaultBuildTask}"
1919
},
2020
{
21-
"name": "Launch Extension Tests",
21+
"name": "Extension Tests",
2222
"type": "extensionHost",
2323
"request": "launch",
2424
"runtimeExecutable": "${execPath}",
2525
"args": [
26+
"--disable-extensions",
2627
"--extensionDevelopmentPath=${workspaceFolder}",
2728
"--extensionsTestsPath=${workspaceFolder}/out/test/suite/index"
2829
],
2930
"stopOnEntry": false,
3031
"outFiles": [
31-
"${workspaceFolder}/out/**/*.js"
32+
"${workspaceFolder}/out/test/**/*.js"
3233
],
3334
"preLaunchTask": "${defaultBuildTask}"
3435
}

src/test/runTests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ async function main() {
1919
// Download VS Code, unzip it and run the integration test
2020
await runTests({ extensionDevelopmentPath, extensionTestsPath });
2121
} catch (err) {
22+
console.error(err);
2223
console.error('Failed to run tests');
2324
process.exit(1);
2425
}

src/test/suite/extension.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
* Licensed under the MIT License. See License.md in the project root for license information.
44
* -------------------------------------------------------------------------------------------- */
55
import * as assert from 'assert';
6-
7-
// You can import and use all API from the 'vscode' module
8-
// as well as import your extension to test it
6+
import { after } from 'mocha';
97
import * as vscode from 'vscode';
10-
// import * as myExtension from '../extension';
118

129
suite('Extension Test Suite', () => {
1310
void vscode.window.showInformationMessage('Start all tests.');
1411

12+
after(() => {
13+
void vscode.window.showInformationMessage('All Tests Done!');
14+
});
15+
1516
test('Sample test', () => {
1617
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
1718
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
1819
});
1920
});
21+
22+
function sleep(ms: number): Promise<void> {
23+
return new Promise(resolve => {
24+
setTimeout(resolve, ms);
25+
});
26+
}

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
},
1616
"exclude": [
1717
"node_modules",
18-
".vscode-test",
19-
"test"
18+
".vscode-test"
2019
]
2120
}

0 commit comments

Comments
 (0)