Skip to content

[PATCH] tests/setup.js v1.0.9 missing STORAGE_KEY global export present in v1.0.11 #207

@ormidales

Description

@ormidales

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

  • global.STORAGE_KEY is exported in all versions of tests/setup.js
  • Both setup files are identical in their global exports
  • Existing tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions