Skip to content

Commit b1d892e

Browse files
committed
update tests again
1 parent 60ce36d commit b1d892e

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

tests/configs/config_variables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
let config = require(`${process.cwd()}/tests/configs/default.js`).configFactory({
22
language: "${MM_LANGUAGE}",
3-
logLevel: ["${MM_LOG_INFO}", "LOG", "WARN", "${MM_LOG_ERROR}"], // Add "DEBUG" for even more logging
3+
logLevel: ["${MM_LOG_ERROR}", "LOG", "WARN", "${MM_LOG_INFO}"],
44
timeFormat: ${MM_TIME_FORMAT},
55
hideConfigSecrets: true,
6-
ipWhitelist: ["${SECRET_IP1}", "${SECRET_IP2}", "::${SECRET_IP3}"]
6+
ipWhitelist: ["${SECRET_IP2}", "::${SECRET_IP3}", "${SECRET_IP1}"]
77
});
88

99
/*************** DO NOT EDIT THE LINE BELOW ***************/

tests/e2e/config_variables_spec.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const defaults = require("../../js/defaults");
21
const helpers = require("./helpers/global-setup");
32

43
describe("config with variables and secrets", () => {
@@ -14,18 +13,22 @@ describe("config with variables and secrets", () => {
1413
expect(config.language).toBe("de");
1514
});
1615

17-
it("config.loglevel should be default", async () => {
18-
expect(config.logLevel).toStrictEqual(defaults.logLevel);
16+
it("config.loglevel should be [\"ERROR\", \"LOG\", \"WARN\", \"INFO\"]", async () => {
17+
expect(config.logLevel).toStrictEqual(["ERROR", "LOG", "WARN", "INFO"]);
1918
});
2019

21-
it("config.ipWhitelist should be default", async () => {
22-
expect(config.ipWhitelist).toStrictEqual(defaults.ipWhitelist);
20+
it("config.ipWhitelist should be [\"::ffff:127.0.0.1\", \"::1\", \"127.0.0.1\"]", async () => {
21+
expect(config.ipWhitelist).toStrictEqual(["::ffff:127.0.0.1", "::1", "127.0.0.1"]);
22+
});
23+
24+
it("config.timeFormat should be 12", async () => {
25+
expect(config.timeFormat).toBe(12); // default is 24
2326
});
2427

2528
it("/config endpoint should show redacted secrets", async () => {
2629
const res = await fetch(`http://localhost:${config.port}/config`);
2730
expect(res.status).toBe(200);
2831
const cfg = await res.json();
29-
expect(cfg.ipWhitelist).toStrictEqual(["**SECRET_IP1**", "**SECRET_IP2**", "::**SECRET_IP3**"]);
32+
expect(cfg.ipWhitelist).toStrictEqual(["**SECRET_IP2**", "::**SECRET_IP3**", "**SECRET_IP1**"]);
3033
});
3134
});

0 commit comments

Comments
 (0)