-
Notifications
You must be signed in to change notification settings - Fork 15
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
clean-up: break filterRequest out into more functions #26
Comments
I've broken some functions out, but I'm having trouble writing tests for background.js because it uses DOM/Web APIs that I guess aren't available in node? E.g.,
@rpl - any advice on how to test these bits? |
@groovecoder yep,there are at least two strategies that we can use: inject the dependency explicitlywe can rewrite the module so that any code that uses the BroadcastChannel is inside a function that took the window object as a parameter, e.g.: exports.backgroundEntryPoint = function({BroadcastChannel}) { the real background script will call the function with the background node
|
for #26: refactor (some) filterRequest code into modules and test
Also, tests and coverage reporting!
Also, tests and coverage reporting!
Return entityName: null if not found
Also, tests and coverage reporting!
Return entityName: null if not found
for #26: refactor: new getRequestEntity function
Closing this. More refactoring/break-out can happen with follow-up issues. |
Probably into a new module, and then write tests.
The text was updated successfully, but these errors were encountered: