-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathhasMinFuncCliVersion.test.ts
30 lines (25 loc) · 1.44 KB
/
hasMinFuncCliVersion.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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createTestActionContext } from '@microsoft/vscode-azext-dev';
import * as assert from 'assert';
import { FuncVersion, hasMinFuncCliVersion } from '../extension.bundle';
suite('hasMinFuncCliVersion', () => {
test('Smaller major version', async () => {
const result: boolean = await hasMinFuncCliVersion(await createTestActionContext(), '2.0.3', FuncVersion.v1);
assert.strictEqual(result, false);
});
test('Greater major version', async () => {
const result: boolean = await hasMinFuncCliVersion(await createTestActionContext(), '2.0.3', FuncVersion.v3);
assert.strictEqual(result, true);
});
test('Same major version, meets minimum', async () => {
const result: boolean = await hasMinFuncCliVersion(await createTestActionContext(), '3.0.0', FuncVersion.v3);
assert.strictEqual(result, true);
});
test('Same major version, doesn\'t meet minimum', async () => {
const result: boolean = await hasMinFuncCliVersion(await createTestActionContext(), '4.9999.0', FuncVersion.v4);
assert.strictEqual(result, false);
});
});