mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
test for index-access style, make object immutable, #1396
This commit is contained in:
@@ -21,6 +21,10 @@ suite('workspace-namespace', () => {
|
||||
assert.ok(config.has('config0'));
|
||||
assert.equal(config.get('config0'), true);
|
||||
assert.equal(config.get('config4'), '');
|
||||
assert.equal(config['config0'], true);
|
||||
assert.equal(config['config4'], '');
|
||||
|
||||
assert.throws(() => config['config4'] = 'valuevalue');
|
||||
|
||||
assert.ok(config.has('nested.config1'));
|
||||
assert.equal(config.get('nested.config1'), 42);
|
||||
@@ -28,6 +32,15 @@ suite('workspace-namespace', () => {
|
||||
assert.equal(config.get('nested.config2'), 'Das Pferd frisst kein Reis.');
|
||||
});
|
||||
|
||||
test('configuration, name vs property', () => {
|
||||
const config = workspace.getConfiguration('farboo');
|
||||
|
||||
assert.ok(config.has('get'));
|
||||
assert.equal(config.get('get'), 'get-prop');
|
||||
assert.deepEqual(config['get'], config.get);
|
||||
assert.throws(() => config['get'] = <any> 'get-prop');
|
||||
});
|
||||
|
||||
test('configuration, getConfig/value', () => {
|
||||
const value = workspace.getConfiguration('farboo.config0');
|
||||
assert.equal(Object.keys(value).length, 2);
|
||||
|
||||
Reference in New Issue
Block a user