Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
test for removing extensions from profile
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Jul 3, 2019
1 parent 9dbe1f5 commit 828c266
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/test/removeProfile.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
/* eslint @typescript-eslint/no-explicit-any: "off" */
import { assert } from "chai";
import * as vscode from "vscode";
import { ConfigKey, ConfigProfilesKey, ConfigStorageKey } from "../constants";
import {
ConfigKey,
ConfigProfilesKey,
ConfigStorageKey,
ConfigExtensionsKey
} from "../constants";
import Config from "../services/config";
import { ExtensionInfo } from "../services/extensions";

suite("remove profile", () => {
const expectedProfileName = "test1";
const expectedProfileSettings = { foo: "bar" };
const expectedExtensions = [
new ExtensionInfo("abcd", "test.ext", "test", "1.0.0", "ext")
];

setup(async () => {
let config = vscode.workspace.getConfiguration(ConfigKey);
Expand All @@ -23,6 +32,13 @@ suite("remove profile", () => {
},
vscode.ConfigurationTarget.Global
);
await config.update(
ConfigExtensionsKey,
{
[expectedProfileName]: expectedExtensions
},
vscode.ConfigurationTarget.Global
);
});

test("can remove profile name", async () => {
Expand All @@ -44,4 +60,14 @@ suite("remove profile", () => {

assert.isUndefined(settings);
});

test("can remove profile extensions", async () => {
let config = new Config();

await config.removeProfileExtensions(expectedProfileName);

let extensions = config.getProfileExtensions(expectedProfileName);

assert.isEmpty(extensions);
});
});

0 comments on commit 828c266

Please # to comment.