-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathutils.test.ts
More file actions
33 lines (24 loc) · 1.36 KB
/
utils.test.ts
File metadata and controls
33 lines (24 loc) · 1.36 KB
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
33
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { assert } from "chai";
import { getImsAuthority } from "../utils";
describe("getImsAuthority", () => {
it("has no prefix when no prefix is defined", async () => {
process.env.IMJS_URL_PREFIX = "";
assert.equal(getImsAuthority(), "https://ims.bentley.com"); // eslint-disable-line @typescript-eslint/no-deprecated
});
it("has correct prefix when prefix is defined", async () => {
process.env.IMJS_URL_PREFIX = "prefix-";
assert.equal(getImsAuthority(), "https://prefix-ims.bentley.com"); // eslint-disable-line @typescript-eslint/no-deprecated
});
it("replaces \"dev-\" prefix with \"qa-\"", async () => {
process.env.IMJS_URL_PREFIX = "dev-";
assert.equal(getImsAuthority(), "https://qa-ims.bentley.com"); // eslint-disable-line @typescript-eslint/no-deprecated
});
it("does not modify \"qa-\" prefix", async () => {
process.env.IMJS_URL_PREFIX = "qa-";
assert.equal(getImsAuthority(), "https://qa-ims.bentley.com"); // eslint-disable-line @typescript-eslint/no-deprecated
});
});