-
Notifications
You must be signed in to change notification settings - Fork 781
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
Support running QUnit in a Web Worker #1022
Comments
What's your usecase? |
@jzaefferer Unit testing code inside a WebWorker/ServiceWorker. |
Yeah, I got that much from your initial ticket. Why do you need to unit test inside a WebWorker/ServiceWorker? |
So I can build a WebWorker/ServiceWorker using TDD. |
What sort of tests would you like to perform that you can't test externally from the Worker? I imagine in most cases the Worker should have functionality initiated from the browser window and return some sort of response, in which case you shouldn't need to run QUnit in the Worker. |
I want to white box test complex worker code. Trying to black box test workers does work, but it's like trying to test your application with only acceptance tests. |
I tend to think most applications should be primarily tested via acceptance tests. Could you modularize the complex code and test it in Node (or something to that effect)? Note, I'm not opposed to supporting additional environments, just making sure there are compelling reasons to do so. What sort of changes do you think would need to happen in order for QUnit to support this? I imagine some sort of communication channel between Browser/Worker and ensuring QUnit doesn't rely on globals not available in the Worker. |
I'm working on hacking a version of QUnit 2.0 to work in a WebWorker/ServiceWorker, but it would be nice to have official support for it.
The text was updated successfully, but these errors were encountered: