clarkbw / jest-webextension-mock

A module to mock WebExtensions in Jest
BSD 3-Clause "New" or "Revised" License
93 stars 37 forks source link

Fix incorrect behavior of `runtime.getURL` #174

Closed vitonsky closed 1 year ago

vitonsky commented 1 year ago

Now browser.runtime.getURL returns path from first argument instead of path + extension URL prefix.

I suggest changes to fix this behavior. Here we use a global object to configure extension URL

clarkbw commented 1 year ago

Looks good so far, can you run npm run build and commit that output?

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (f3b766b) 99.50% compared to head (a71d1b6) 99.50%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #174 +/- ## ======================================= Coverage 99.50% 99.50% ======================================= Files 14 14 Lines 202 204 +2 Branches 43 43 ======================================= + Hits 201 203 +2 Misses 1 1 ``` | [Impacted Files](https://codecov.io/gh/clarkbw/jest-webextension-mock/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/index.js](https://codecov.io/gh/clarkbw/jest-webextension-mock/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2luZGV4Lmpz) | `100.00% <100.00%> (ø)` | | | [src/runtime.js](https://codecov.io/gh/clarkbw/jest-webextension-mock/pull/174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3J1bnRpbWUuanM=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.