-
Notifications
You must be signed in to change notification settings - Fork 511
/
Copy pathsettings.test.ts
33 lines (27 loc) · 1.32 KB
/
settings.test.ts
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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as assert from "assert";
import * as vscode from "vscode";
import { Settings, getSettings, getEffectiveConfigurationTarget, changeSetting, CommentType } from "../../src/settings";
describe("Settings E2E", function () {
it("Loads without error", function () {
assert.doesNotThrow(getSettings);
});
it("Loads the correct defaults", function () {
const testSettings = new Settings();
const actualSettings = getSettings();
assert.deepStrictEqual(actualSettings, testSettings);
});
it("Updates correctly", async function () {
await changeSetting("helpCompletion", CommentType.LineComment, false, undefined);
assert.strictEqual(getSettings().helpCompletion, CommentType.LineComment);
});
it("Gets the effective configuration target", async function () {
await changeSetting("helpCompletion", CommentType.LineComment, false, undefined);
let target = getEffectiveConfigurationTarget("helpCompletion");
assert.strictEqual(target, vscode.ConfigurationTarget.Workspace);
await changeSetting("helpCompletion", undefined, false, undefined);
target = getEffectiveConfigurationTarget("helpCompletion");
assert.strictEqual(target, undefined);
});
});