mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { ConfigurationModel, merge } from 'vs/platform/configuration/common/configuration';
|
||||
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
suite('Configuration', () => {
|
||||
|
||||
suiteSetup(() => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'overridable': true
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('simple merge', () => {
|
||||
let base = { 'a': 1, 'b': 2 };
|
||||
merge(base, { 'a': 3, 'c': 4 }, true);
|
||||
assert.deepEqual(base, { 'a': 3, 'b': 2, 'c': 4 });
|
||||
base = { 'a': 1, 'b': 2 };
|
||||
merge(base, { 'a': 3, 'c': 4 }, false);
|
||||
assert.deepEqual(base, { 'a': 1, 'b': 2, 'c': 4 });
|
||||
});
|
||||
|
||||
test('Recursive merge', () => {
|
||||
const base = { 'a': { 'b': 1 } };
|
||||
merge(base, { 'a': { 'b': 2 } }, true);
|
||||
assert.deepEqual(base, { 'a': { 'b': 2 } });
|
||||
});
|
||||
|
||||
test('simple merge using configuration', () => {
|
||||
let base = new ConfigurationModel<any>({ 'a': 1, 'b': 2 });
|
||||
let add = new ConfigurationModel<any>({ 'a': 3, 'c': 4 });
|
||||
let result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 });
|
||||
});
|
||||
|
||||
test('Recursive merge using config models', () => {
|
||||
let base = new ConfigurationModel({ 'a': { 'b': 1 } });
|
||||
let add = new ConfigurationModel({ 'a': { 'b': 2 } });
|
||||
let result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': { 'b': 2 } });
|
||||
});
|
||||
|
||||
test('Test contents while getting an existing property', () => {
|
||||
let testObject = new ConfigurationModel({ 'a': 1 });
|
||||
assert.deepEqual(testObject.getContentsFor('a'), 1);
|
||||
|
||||
testObject = new ConfigurationModel<any>({ 'a': { 'b': 1 } });
|
||||
assert.deepEqual(testObject.getContentsFor('a'), { 'b': 1 });
|
||||
});
|
||||
|
||||
test('Test contents are undefined for non existing properties', () => {
|
||||
const testObject = new ConfigurationModel({ awesome: true });
|
||||
|
||||
assert.deepEqual(testObject.getContentsFor('unknownproperty'), undefined);
|
||||
});
|
||||
|
||||
test('Test override gives all content merged with overrides', () => {
|
||||
const testObject = new ConfigurationModel<any>({ 'a': 1, 'c': 1 }, [], [{ identifiers: ['b'], contents: { 'a': 2 } }]);
|
||||
|
||||
assert.deepEqual(testObject.override('b').contents, { 'a': 2, 'c': 1 });
|
||||
});
|
||||
});
|
||||
148
src/vs/platform/configuration/test/common/model.test.ts
Normal file
148
src/vs/platform/configuration/test/common/model.test.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { CustomConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/model';
|
||||
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
suite('Configuration', () => {
|
||||
|
||||
suiteSetup(() => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'overridable': true
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('simple merge using models', () => {
|
||||
let base = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 }));
|
||||
let add = new CustomConfigurationModel(JSON.stringify({ 'a': 3, 'c': 4 }));
|
||||
let result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 });
|
||||
});
|
||||
|
||||
test('simple merge with an undefined contents', () => {
|
||||
let base = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 }));
|
||||
let add = new CustomConfigurationModel(null);
|
||||
let result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': 1, 'b': 2 });
|
||||
|
||||
base = new CustomConfigurationModel(null);
|
||||
add = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 }));
|
||||
result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': 1, 'b': 2 });
|
||||
|
||||
base = new CustomConfigurationModel(null);
|
||||
add = new CustomConfigurationModel(null);
|
||||
result = base.merge(add);
|
||||
assert.deepEqual(result.contents, {});
|
||||
});
|
||||
|
||||
test('Recursive merge using config models', () => {
|
||||
let base = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 1 } }));
|
||||
let add = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 2 } }));
|
||||
let result = base.merge(add);
|
||||
assert.deepEqual(result.contents, { 'a': { 'b': 2 } });
|
||||
});
|
||||
|
||||
test('Test contents while getting an existing property', () => {
|
||||
let testObject = new CustomConfigurationModel(JSON.stringify({ 'a': 1 }));
|
||||
assert.deepEqual(testObject.getContentsFor('a'), 1);
|
||||
|
||||
testObject = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 1 } }));
|
||||
assert.deepEqual(testObject.getContentsFor('a'), { 'b': 1 });
|
||||
});
|
||||
|
||||
test('Test contents are undefined for non existing properties', () => {
|
||||
const testObject = new CustomConfigurationModel(JSON.stringify({
|
||||
awesome: true
|
||||
}));
|
||||
|
||||
assert.deepEqual(testObject.getContentsFor('unknownproperty'), undefined);
|
||||
});
|
||||
|
||||
test('Test contents are undefined for undefined config', () => {
|
||||
const testObject = new CustomConfigurationModel(null);
|
||||
|
||||
assert.deepEqual(testObject.getContentsFor('unknownproperty'), undefined);
|
||||
});
|
||||
|
||||
test('Test configWithOverrides gives all content merged with overrides', () => {
|
||||
const testObject = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'c': 1, '[b]': { 'a': 2 } }));
|
||||
|
||||
assert.deepEqual(testObject.override('b').contents, { 'a': 2, 'c': 1, '[b]': { 'a': 2 } });
|
||||
});
|
||||
|
||||
test('Test configWithOverrides gives empty contents', () => {
|
||||
const testObject = new CustomConfigurationModel(null);
|
||||
|
||||
assert.deepEqual(testObject.override('b').contents, {});
|
||||
});
|
||||
|
||||
test('Test update with empty data', () => {
|
||||
const testObject = new CustomConfigurationModel();
|
||||
testObject.update('');
|
||||
|
||||
assert.deepEqual(testObject.contents, {});
|
||||
assert.deepEqual(testObject.keys, []);
|
||||
|
||||
testObject.update(null);
|
||||
|
||||
assert.deepEqual(testObject.contents, {});
|
||||
assert.deepEqual(testObject.keys, []);
|
||||
|
||||
testObject.update(undefined);
|
||||
|
||||
assert.deepEqual(testObject.contents, {});
|
||||
assert.deepEqual(testObject.keys, []);
|
||||
});
|
||||
|
||||
test('Test registering the same property again', () => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': 'a',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'a': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
}
|
||||
}
|
||||
});
|
||||
assert.equal(true, new DefaultConfigurationModel().getContentsFor('a'));
|
||||
});
|
||||
|
||||
test('Test registering the language property', () => {
|
||||
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration({
|
||||
'id': '[a]',
|
||||
'order': 1,
|
||||
'title': 'a',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'[a]': {
|
||||
'description': 'a',
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
}
|
||||
}
|
||||
});
|
||||
assert.equal(undefined, new DefaultConfigurationModel().getContentsFor('[a]'));
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,79 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TrieMap } from 'vs/base/common/map';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { getConfigurationKeys } from 'vs/platform/configuration/common/model';
|
||||
import { IConfigurationOverrides, IConfigurationService, getConfigurationValue, IConfigurationValue, IConfigurationKeys, IConfigurationValues, IConfigurationData, Configuration, ConfigurationModel } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export class TestConfigurationService extends EventEmitter implements IConfigurationService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private configuration = Object.create(null);
|
||||
|
||||
private configurationByRoot: TrieMap<any> = new TrieMap<any>();
|
||||
|
||||
public reloadConfiguration<T>(section?: string): TPromise<T> {
|
||||
return TPromise.as(this.getConfiguration());
|
||||
}
|
||||
|
||||
public getConfiguration(section?: string, overrides?: IConfigurationOverrides): any {
|
||||
if (overrides && overrides.resource) {
|
||||
const configForResource = this.configurationByRoot.findSubstr(overrides.resource.fsPath);
|
||||
return configForResource || this.configuration;
|
||||
}
|
||||
|
||||
return this.configuration;
|
||||
}
|
||||
|
||||
public getConfigurationData(): IConfigurationData<any> {
|
||||
return new Configuration(new ConfigurationModel(), new ConfigurationModel(this.configuration)).toData();
|
||||
}
|
||||
|
||||
public setUserConfiguration(key: any, value: any, root?: URI): Thenable<void> {
|
||||
if (root) {
|
||||
const configForRoot = this.configurationByRoot.lookUp(root.fsPath) || Object.create(null);
|
||||
configForRoot[key] = value;
|
||||
this.configurationByRoot.insert(root.fsPath, configForRoot);
|
||||
} else {
|
||||
this.configuration[key] = value;
|
||||
}
|
||||
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public onDidUpdateConfiguration() {
|
||||
return { dispose() { } };
|
||||
}
|
||||
|
||||
public lookup<C>(key: string, overrides?: IConfigurationOverrides): IConfigurationValue<C> {
|
||||
const config = this.getConfiguration(undefined, overrides);
|
||||
|
||||
return {
|
||||
value: getConfigurationValue<C>(config, key),
|
||||
default: getConfigurationValue<C>(config, key),
|
||||
user: getConfigurationValue<C>(config, key),
|
||||
workspace: null,
|
||||
folder: null
|
||||
};
|
||||
}
|
||||
|
||||
public keys(): IConfigurationKeys {
|
||||
return {
|
||||
default: getConfigurationKeys(),
|
||||
user: Object.keys(this.configuration),
|
||||
workspace: [],
|
||||
folder: []
|
||||
};
|
||||
}
|
||||
|
||||
public values(): IConfigurationValues {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import assert = require('assert');
|
||||
import os = require('os');
|
||||
import path = require('path');
|
||||
import fs = require('fs');
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ConfigurationService } from 'vs/platform/configuration/node/configurationService';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import extfs = require('vs/base/node/extfs');
|
||||
import uuid = require('vs/base/common/uuid');
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
class SettingsTestEnvironmentService extends EnvironmentService {
|
||||
|
||||
constructor(args: ParsedArgs, _execPath: string, private customAppSettingsHome) {
|
||||
super(args, _execPath);
|
||||
}
|
||||
|
||||
get appSettingsPath(): string { return this.customAppSettingsHome; }
|
||||
}
|
||||
|
||||
suite('ConfigurationService - Node', () => {
|
||||
|
||||
function testFile(callback: (path: string, cleanUp: (callback: () => void) => void) => void): void {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'config', id);
|
||||
const testFile = path.join(newDir, 'config.json');
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
callback(testFile, (callback) => extfs.del(parentDir, os.tmpdir(), () => { }, callback));
|
||||
});
|
||||
}
|
||||
|
||||
test('simple', (done: () => void) => {
|
||||
testFile((testFile, cleanUp) => {
|
||||
fs.writeFileSync(testFile, '{ "foo": "bar" }');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
|
||||
test('config gets flattened', (done: () => void) => {
|
||||
testFile((testFile, cleanUp) => {
|
||||
fs.writeFileSync(testFile, '{ "testworkbench.editor.tabs": true }');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ testworkbench: { editor: { tabs: boolean } } }>();
|
||||
assert.ok(config);
|
||||
assert.ok(config.testworkbench);
|
||||
assert.ok(config.testworkbench.editor);
|
||||
assert.equal(config.testworkbench.editor.tabs, true);
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
|
||||
test('error case does not explode', (done: () => void) => {
|
||||
testFile((testFile, cleanUp) => {
|
||||
fs.writeFileSync(testFile, ',,,,');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
|
||||
test('missing file does not explode', () => {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'config', id);
|
||||
const testFile = path.join(newDir, 'config.json');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
const config = service.getConfiguration<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
|
||||
service.dispose();
|
||||
});
|
||||
|
||||
test('reloadConfiguration', (done: () => void) => {
|
||||
testFile((testFile, cleanUp) => {
|
||||
fs.writeFileSync(testFile, '{ "foo": "bar" }');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let config = service.getConfiguration<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
fs.writeFileSync(testFile, '{ "foo": "changed" }');
|
||||
|
||||
// still outdated
|
||||
config = service.getConfiguration<{ foo: string }>();
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'bar');
|
||||
|
||||
// force a reload to get latest
|
||||
service.reloadConfiguration<{ foo: string }>().then(config => {
|
||||
assert.ok(config);
|
||||
assert.equal(config.foo, 'changed');
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('model defaults', (done: () => void) => {
|
||||
interface ITestSetting {
|
||||
configuration: {
|
||||
service: {
|
||||
testSetting: string;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const configurationRegistry = <IConfigurationRegistry>Registry.as(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': '_test',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'configuration.service.testSetting': {
|
||||
'type': 'string',
|
||||
'default': 'isSet'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let serviceWithoutFile = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, '__testFile'));
|
||||
let setting = serviceWithoutFile.getConfiguration<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isSet');
|
||||
|
||||
testFile((testFile, cleanUp) => {
|
||||
fs.writeFileSync(testFile, '{ "testworkbench.editor.tabs": true }');
|
||||
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let setting = service.getConfiguration<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isSet');
|
||||
|
||||
fs.writeFileSync(testFile, '{ "configuration.service.testSetting": "isChanged" }');
|
||||
|
||||
service.reloadConfiguration().then(() => {
|
||||
let setting = service.getConfiguration<ITestSetting>();
|
||||
|
||||
assert.ok(setting);
|
||||
assert.equal(setting.configuration.service.testSetting, 'isChanged');
|
||||
|
||||
service.dispose();
|
||||
serviceWithoutFile.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('lookup', (done: () => void) => {
|
||||
const configurationRegistry = <IConfigurationRegistry>Registry.as(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': '_test',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'lookup.service.testSetting': {
|
||||
'type': 'string',
|
||||
'default': 'isSet'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
testFile((testFile, cleanUp) => {
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let res = service.lookup('something.missing');
|
||||
assert.strictEqual(res.value, void 0);
|
||||
assert.strictEqual(res.default, void 0);
|
||||
assert.strictEqual(res.user, void 0);
|
||||
|
||||
res = service.lookup('lookup.service.testSetting');
|
||||
assert.strictEqual(res.default, 'isSet');
|
||||
assert.strictEqual(res.value, 'isSet');
|
||||
assert.strictEqual(res.user, void 0);
|
||||
|
||||
fs.writeFileSync(testFile, '{ "lookup.service.testSetting": "bar" }');
|
||||
|
||||
return service.reloadConfiguration().then(() => {
|
||||
res = service.lookup('lookup.service.testSetting');
|
||||
assert.strictEqual(res.default, 'isSet');
|
||||
assert.strictEqual(res.user, 'bar');
|
||||
assert.strictEqual(res.value, 'bar');
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('lookup with null', (done: () => void) => {
|
||||
const configurationRegistry = <IConfigurationRegistry>Registry.as(ConfigurationExtensions.Configuration);
|
||||
configurationRegistry.registerConfiguration({
|
||||
'id': '_testNull',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'lookup.service.testNullSetting': {
|
||||
'type': 'null',
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
testFile((testFile, cleanUp) => {
|
||||
const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile));
|
||||
|
||||
let res = service.lookup('lookup.service.testNullSetting');
|
||||
assert.strictEqual(res.default, null);
|
||||
assert.strictEqual(res.value, null);
|
||||
assert.strictEqual(res.user, void 0);
|
||||
|
||||
fs.writeFileSync(testFile, '{ "lookup.service.testNullSetting": null }');
|
||||
|
||||
return service.reloadConfiguration().then(() => {
|
||||
res = service.lookup('lookup.service.testNullSetting');
|
||||
assert.strictEqual(res.default, null);
|
||||
assert.strictEqual(res.value, null);
|
||||
assert.strictEqual(res.user, null);
|
||||
|
||||
service.dispose();
|
||||
|
||||
cleanUp(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user