-
Notifications
You must be signed in to change notification settings - Fork 511
/
Copy pathpaths.test.ts
29 lines (24 loc) · 1.21 KB
/
paths.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import assert from "assert";
import * as vscode from "vscode";
import { IPowerShellExtensionClient } from "../../src/features/ExternalApi";
import utils = require("../utils");
import { checkIfDirectoryExists, checkIfFileExists, ShellIntegrationScript } from "../../src/utils";
describe("Path assumptions", function () {
let globalStorageUri: vscode.Uri;
before(async () => {
const extension: IPowerShellExtensionClient = await utils.ensureEditorServicesIsConnected();
globalStorageUri = extension.getStorageUri();
});
it("Creates the session folder at the correct path", async function () {
assert(await checkIfDirectoryExists(vscode.Uri.joinPath(globalStorageUri, "sessions")));
});
it("Creates the log folder at the correct path", async function () {
assert(await checkIfDirectoryExists(vscode.Uri.joinPath(globalStorageUri, "logs")));
});
it("Finds the Terminal Shell Integration Script", async function () {
// If VS Code changes the location of the script, we need to know ASAP (as it's not a public API).
assert(await checkIfFileExists(ShellIntegrationScript));
});
});