How to test chrome extension API?
See original GitHub issueIn a function changeExtensionTooltip
I have a line of code like this:
chrome.browserAction.setTitle({title: text});
And I want to assert that method chrome.browserAction.setTitle
has been called once and that it has received {title: 'WakaTime'}
.
Can someone help with this? @Stephn-R
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Using the chrome.test API
The chrome.test extension API is a limited testing framework implemented as an extension API. It is primarily used in order to provide testing...
Read more >How to test chrome extensions? - Stack Overflow
If you want to test pages directly, you can orchestrate your extension to open new tabs (chrome.tab.create({"url" : "someurl"}). For each of the...
Read more >Talend API Tester - Free Edition
Talend API Tester makes it easy to invoke, discover and test HTTP and ... Chrome extensions which need access to internet resources must ......
Read more >API reference - Chrome Developers
The complete reference to all APIs made available to Chrome Extensions. This includes APIs for the deprecated Chrome Apps platform as well as...
Read more >Complete Guide to Test Chrome Extensions with Puppeteer
Testing strategy · Open a browser tab with the target application. · Load the browser extension and open the popup in a new...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @mabasic, its very easy to do exactly that. Since Jest is a descendant of Jasmine, you can use the Spy tool to do this
Here is the test I wrote: https://github.com/wakatime/chrome-wakatime/blob/master/tests/helpers/changeExtensionTooltip.spec.js
And here is the helper which I want to test: https://github.com/wakatime/chrome-wakatime/blob/master/assets/js/helpers/changeExtensionTooltip.js