chore: Fix types in tests 29/N.

This commit is contained in:
cpojer
2026-02-17 14:32:43 +09:00
parent 03e6acd051
commit ecf1c955a1
12 changed files with 67 additions and 35 deletions

View File

@@ -57,7 +57,7 @@ describe("server-context hot-reload profiles", () => {
const resolved = resolveBrowserConfig(cfg.browser, cfg);
// Verify cache is primed (without desktop)
expect(cfg.browser.profiles.desktop).toBeUndefined();
expect(cfg.browser?.profiles?.desktop).toBeUndefined();
const state = {
server: null,
port: 18791,
@@ -79,7 +79,7 @@ describe("server-context hot-reload profiles", () => {
// 3. Verify without clearConfigCache, loadConfig() still returns stale cached value
const staleCfg = loadConfig();
expect(staleCfg.browser.profiles.desktop).toBeUndefined(); // Cache is stale!
expect(staleCfg.browser?.profiles?.desktop).toBeUndefined(); // Cache is stale!
// 4. Hot-reload should read fresh config for the lookup (createConfigIO().loadConfig()),
// without flushing the global loadConfig cache.
@@ -97,7 +97,7 @@ describe("server-context hot-reload profiles", () => {
// 6. Verify GLOBAL cache was NOT cleared - subsequent simple loadConfig() still sees STALE value
// This confirms the fix: we read fresh config for the specific profile lookup without flushing the global cache
const stillStaleCfg = loadConfig();
expect(stillStaleCfg.browser.profiles.desktop).toBeUndefined();
expect(stillStaleCfg.browser?.profiles?.desktop).toBeUndefined();
});
it("forProfile still throws for profiles that don't exist in fresh config", async () => {