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
Add browser test to keep track of browserify compability. #1308
Conversation
@eiriksm the Travis build is failing, Edit: that's probably due to code added between the last coveralls build |
The build is failing because some of the dependencies seem to have dependencies which are declared with a caret (not supported on node .8). I will probably make a more compact commit and push when the travis build is succeeding again. I am guessing the coverage decrease is because the node .8 tests did not run. Maybe? |
Argh. Now it actually installs fine, but karma-browserify does not work on .8. Will have to look at it later I guess. |
Yay. Fun fact: the latest code and commit (that passed ) was written on the bus with my phone. Thats a first. Ready for review. I'll squash some commits if it looks ok |
Instead of making a network request to api.github.com, you could add test fixtures locally and use Karma to serve these up locally. |
Thats true, but I also wanted to make sure https and CORS worked in the browser, so that was the reason i picked api.github.com |
Awesome stuff! I agree with @tschaub that we should run test servers locally, but I'm good to put this in place first. As a future change we can mock a test HTTPS server and have it send back Would like comment from other maintainers first though. @FredKSchott @simov @mikeal and anyone else |
Add browser test to keep track of browserify compability.
Whoops, I didn't mean to click the merge button yet 🐑 oh well, I guess we'll address any problems separately. |
👍 tests are good 🐺 |
@eiriksm we're having problems with requests to api.github.com from Travis (see this build log for example). It's time to change the browser tests over to using a mock server. I know you can start PhantomJS with the |
Sure. I'm on it |
As discussed (or more like suggested) over at issue #1307: A browser test to make sure request can be built with browserify.
Last time it broke it was because one of the dependencies had a dependency which in turn used
fs.readFile
, which obviously does not work well in browsers. But those things are hard to spot unless it is automated.So to sum it up. This is not for testing that all features actually work in the browser. Just to make sure it will bundle nicely.
One negative thing about this is the added dependencies and the added test build time. In addition to having more tests to "support" of course. For me the positive effects outshines this, but I can understand if someone might make that argument.
Anyway, this is the first take. Open for discussion, of course.
Oh, and thanks once more for making and maintaining this fantastic library. Have a nice day!