Category: testing
Severity: patch
File(s): tests/setup.js (v1.0.9 snapshot)
Description
The v1.0.9 version of tests/setup.js does not expose global.STORAGE_KEY from utils.js, while the v1.0.11 version does. Any test in the v1.0.9 snapshot that exercises code paths in background.js relying on STORAGE_KEY (e.g. the storage.onChanged listener) would receive undefined for that global, potentially masking failures. The two setup files should be kept in sync.
Problematic code example
// v1.0.9 tests/setup.js — STORAGE_KEY not exported
const utils = require("../utils.js");
global.IPV4_REGEX = utils.IPV4_REGEX;
global.IPV6_REGEX = utils.IPV6_REGEX;
global.stripIPv6Brackets = utils.stripIPv6Brackets;
global.getRootDomain = utils.getRootDomain;
Suggested fix
const utils = require("../utils.js");
global.STORAGE_KEY = utils.STORAGE_KEY; // ← add this line
global.IPV4_REGEX = utils.IPV4_REGEX;
global.IPV6_REGEX = utils.IPV6_REGEX;
global.stripIPv6Brackets = utils.stripIPv6Brackets;
global.getRootDomain = utils.getRootDomain;
Acceptance criteria
Category: testing
Severity: patch
File(s):
tests/setup.js(v1.0.9 snapshot)Description
The v1.0.9 version of
tests/setup.jsdoes not exposeglobal.STORAGE_KEYfromutils.js, while the v1.0.11 version does. Any test in the v1.0.9 snapshot that exercises code paths inbackground.jsrelying onSTORAGE_KEY(e.g. thestorage.onChangedlistener) would receiveundefinedfor that global, potentially masking failures. The two setup files should be kept in sync.Problematic code example
Suggested fix
Acceptance criteria
global.STORAGE_KEYis exported in all versions oftests/setup.js