Skip to content

Commit b094eec

Browse files
committed
test settings
1 parent b50d534 commit b094eec

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// Note: This example test is leveraging the Mocha test framework.
3+
// Please refer to their documentation on https://mochajs.org/ for help.
4+
//
5+
6+
// Place this right on top
7+
import { initialize } from './initialize';
8+
// The module 'assert' provides assertion methods from node
9+
import * as assert from 'assert';
10+
11+
// You can import and use all API from the 'vscode' module
12+
// as well as import your extension to test it
13+
import * as vscode from 'vscode';
14+
import { PythonSettings } from '../client/common/configSettings';
15+
16+
const pythonSettings = PythonSettings.getInstance();
17+
18+
// Defines a Mocha test suite to group tests of similar kind together
19+
suite('Configuration Settings', () => {
20+
setup(done => {
21+
initialize().then(() => done(), done);
22+
});
23+
test('Check Values', done => {
24+
const pythonConfig = vscode.workspace.getConfiguration('python');
25+
Object.keys(pythonSettings).forEach(key => {
26+
const settingValue = pythonConfig.get(key, 'Not a config');
27+
if (settingValue === 'Not a config') {
28+
return;
29+
}
30+
assert.deepEqual(settingValue, pythonSettings[key], `Setting ${key} not the same`);
31+
});
32+
33+
done();
34+
});
35+
});

0 commit comments

Comments
 (0)