-
Notifications
You must be signed in to change notification settings - Fork 510
/
Copy pathUpdatePowerShell.test.ts
27 lines (24 loc) · 1.47 KB
/
UpdatePowerShell.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as assert from "assert";
import { GitHubReleaseInformation } from "../../src/features/UpdatePowerShell";
// Due to Azure DevOps using the same macOS instances, the macOS builds hit
// the GitHub API rate limit often. Let's skip these tests on macOS until
// they are hooked up to only run on release.
if (process.env.TF_BUILD && process.platform === "win32") {
describe("UpdatePowerShell tests", function() {
it("Can get the latest version", async function() {
const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(false);
assert.strictEqual(release.isPreview, false, "expected to not be preview.");
assert.strictEqual(
release.version.prerelease.length === 0, true, "expected to not have preview in version.");
assert.strictEqual(release.assets.length > 0, true, "expected to have assets.");
});
it("Can get the latest preview version", async function() {
const release: GitHubReleaseInformation = await GitHubReleaseInformation.FetchLatestRelease(true);
assert.strictEqual(release.isPreview, true, "expected to be preview.");
assert.strictEqual(release.version.prerelease.length > 0, true, "expected to have preview in version.");
assert.strictEqual(release.assets.length > 0, true, "expected to have assets.");
});
});
}