xhr: Wrote tests for xhr.js

- [ ] @davestein
missing semicolon, sniffs should pick that up. @Aintaer - did we not config this repo yet?