-
Notifications
You must be signed in to change notification settings - Fork 511
/
Copy pathpaths.test.ts
32 lines (27 loc) · 1.22 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
30
31
32
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as assert from "assert";
import * as fs from "fs";
import * as path from "path";
import * as vscode from "vscode";
import { IPowerShellExtensionClient } from "../../src/features/ExternalApi";
import utils = require("../utils");
describe("Path assumptions", function () {
let storageUri: vscode.Uri;
before(async () => {
const extension: IPowerShellExtensionClient = await utils.ensureEditorServicesIsConnected();
storageUri = extension.getStorageUri();
});
// TODO: This is skipped because it interferes with other tests. Either
// need to find a way to close the opened folder via a Code API, or find
// another way to test this.
it.skip("Opens the examples folder at the expected path", async function () {
assert(await vscode.commands.executeCommand("PowerShell.OpenExamplesFolder"));
});
it("Creates the session folder at the correct path", function () {
assert(fs.existsSync(path.resolve(utils.rootPath, "sessions")));
});
it("Creates the log folder at the correct path", function () {
assert(fs.existsSync(vscode.Uri.joinPath(storageUri, "logs").fsPath));
});
});