xhr: Wrote tests for xhr.js