Skip to content

replace template_spec test with config_variables test#4034

Open
khassel wants to merge 2 commits intoMagicMirrorOrg:developfrom
khassel:var-test
Open

replace template_spec test with config_variables test#4034
khassel wants to merge 2 commits intoMagicMirrorOrg:developfrom
khassel:var-test

Conversation

@khassel
Copy link
Collaborator

@khassel khassel commented Feb 8, 2026

After introducing new config loading this PR replaces the obsolete template test with a config test.

@KristjanESPERANTO
Copy link
Collaborator

I'm not entirely sure, but I think the tests might not properly validate variable substitution? 🤔

The current tests check that logLevel and ipWhitelist equal the defaults, but the .env values are set such that they produce exactly those defaults after substitution:

  • ["INFO", "LOG", "WARN", "ERROR"] = default
  • ["127.0.0.1", "::ffff:127.0.0.1", "::1"] = default

These tests would pass even if substitution was broken. A test for timeFormat would be better since it's the only value that differs from the default:

it("config.timeFormat should be 12 from MM_TIME_FORMAT variable", async () => {
    expect(config.timeFormat).toBe(12); // default is 24
});

This should better verify that substitution works. WDYT?

@KristjanESPERANTO
Copy link
Collaborator

By the way: I just wanted to say that I'm really excited that we can now hide the secrets from the front end 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants