forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjedilsp.smoke.test.ts
More file actions
43 lines (37 loc) · 1.42 KB
/
Copy pathjedilsp.smoke.test.ts
File metadata and controls
43 lines (37 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as vscode from 'vscode';
import { openFile, waitForCondition } from '../common';
import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_SMOKE_TEST } from '../constants';
import { closeActiveWindows, initialize, initializeTest } from '../initialize';
suite('Smoke Test: Jedi LSP', () => {
suiteSetup(async function () {
if (!IS_SMOKE_TEST) {
return this.skip();
}
await initialize();
return undefined;
});
setup(initializeTest);
suiteTeardown(closeActiveWindows);
teardown(closeActiveWindows);
test('Verify diagnostics on a python file', async () => {
const file = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'python_files', 'intellisense', 'test.py');
const outputFile = path.join(path.dirname(file), 'ds.log');
if (await fs.pathExists(outputFile)) {
await fs.unlink(outputFile);
}
const textDocument = await openFile(file);
waitForCondition(
async () => {
const diagnostics = vscode.languages.getDiagnostics(textDocument.uri);
return diagnostics && diagnostics.length >= 1;
},
60_000,
`No diagnostics found in file with invalid syntax`,
);
});
});