xhr
xhr copied to clipboard
Use a service for running tests in browsers
[edited]
The idea is to find and configure a service for running tests in multiple browsers to monitor browser support automatically.
The trick is, we need the server side for the tests running in the same origin.
See how npm test
does it now.
@Raynos I set up zuul and got saucelab account for opensource, but it seems like I'm missing something. The tests start and then timeout or break. Could you verify if that's also happening for you? I tried starting with different browsers etc. (There are also cross-domain issued in saucelab's IE8 that didn't happen on my VM, but that's for later)
It might be because they don't support making requests outside, but I didn't find it in docs.
I committed the zuul setup https://github.com/Raynos/xhr/tree/zuul-saucelabs It works with regular ~/.zuulrc
I couldn't get Zuul + Saucelabs to work very well for my projects, but I've had decent luck with Browserstack. See http://joshduff.com/#!/post/2015-08-automated-testing-with-tape-and-browserstack.md
You need to set up access to saucelabs. But the tests may not work currently as they're making requests outside - I'm not sure if saucelabs is allowing that.
I have a free/open source Saucelabs account, but the test limit was so low that I hit it right away.
But I'd need to run the mock server to test xhr. browserstack runner doesn't allow for that...
Now that I see BrowserStack claims they support running a mock server. @TehShrike would you mind helping me out with getting this repo configured with BrowserStack and browserstack-tape-reporter
?
I went back and poked at it recently, and browserstack-runner was completely borked for me, thus borking browserstack-tape-reporter :-( I haven't dived into automated browser testing since then, so I don't actually have a good way at hand to pull off testing with BrowserStack.
**EDIT: I probably spoke too soon, just noticed https://github.com/naugtur/xhr#mocking-requests Doesn't yet make everything easy, but I see how this it's not this library's "fault" :)
I think it would be completely fine if your library would work with https://www.npmjs.com/package/xhr-mock (I haven't dig deep into this, but it seems that you cache the object, so by the time I want to replace it, it's already too late)