Skip to content

fix: connect unit tests to actual source code#33

Open
ArmaanjeetSandhu wants to merge 1 commit into
fferrin:masterfrom
ArmaanjeetSandhu:fix/test-source-integrity
Open

fix: connect unit tests to actual source code#33
ArmaanjeetSandhu wants to merge 1 commit into
fferrin:masterfrom
ArmaanjeetSandhu:fix/test-source-integrity

Conversation

@ArmaanjeetSandhu
Copy link
Copy Markdown

@ArmaanjeetSandhu ArmaanjeetSandhu commented Feb 17, 2026

Previously, tests/unit/freeUrl.test.js contained a hardcoded copy of the freeUrl function. This meant that changes to the actual extension logic in content.js were not being verified, leading to potential false positives.

This commit:

  • Modifies extension/content.js to conditionally export freeUrl for Node.js environments
  • Wraps the DOM event listeners in content.js to prevent execution during testing
  • Updates tests/unit/freeUrl.test.js to import the function directly from the source

Previously, `tests/unit/freeUrl.test.js` contained
a hardcoded copy of the `freeUrl` function. This
meant that changes to the actual extension logic
in `content.js` were not being verified, leading
to potential false positives.

This commit:
- Modifies `extension/content.js` to conditionally
export `freeUrl` for Node.js environments
- Wraps the DOM event listeners in `content.js` to
prevent execution during testing
- Updates `tests/unit/freeUrl.test.js` to import
the function directly from the source
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