Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tabs.onRemoved and tabs.onCreated mocks #180

Closed
wants to merge 2 commits into from
Closed

feat: add tabs.onRemoved and tabs.onCreated mocks #180

wants to merge 2 commits into from

Conversation

RickyMarou
Copy link
Collaborator

Hello 👋

I'm a core contributor to Adblock plus and i'm experimenting with using this library to help us write more unit tests.
I noticed that it misses a few methods on the tabs API that we would need to make use of, also noticed the issue #107 where somebody else encountered a similar problem.

I took a (very) quick stab at adding those missing methods:

I followed the existing pattern that exists with onUpdated, i.e. I did not implement mock functionalities to make the addListener, removeListener and hasListener work (we could for an example keep track of the functions added as listeners and return correct values in hasListener), but simply mocked them with jest.fn().

Looking forward to feedback to on this 🤞

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.51%. Comparing base (c0b1bbf) to head (6d79ad5).
Report is 1 commits behind head on main.

❗ Current head 6d79ad5 differs from pull request most recent head c1ce3ba. Consider uploading reports for the commit c1ce3ba to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #180   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files          15       15           
  Lines         207      207           
  Branches       43       43           
=======================================
  Hits          206      206           
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RickyMarou
Copy link
Collaborator Author

Hey @clarkbw 👋 Anything I can do to get this merged?

I'd actually love to contribute more to this repo, I think it's super useful for extension developers 😊

@RickyMarou RickyMarou closed this by deleting the head repository Apr 22, 2024
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