2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00
Files
axios/test/specs/instance.spec.js
T
2015-10-03 09:38:16 -07:00

42 lines
813 B
JavaScript

var axios = require('../../index');
describe('instance', function () {
beforeEach(function () {
jasmine.Ajax.install();
});
afterEach(function () {
jasmine.Ajax.uninstall();
});
it('should make an http request', function (done) {
var instance = axios.createNew();
instance.request({
url: '/foo'
});
setTimeout(function () {
request = jasmine.Ajax.requests.mostRecent();
expect(request.url).toBe('/foo');
done();
}, 0);
});
it('should use instance options', function (done) {
var instance = axios.createNew({ timeout: 1000 });
instance.request({
url: '/foo'
});
setTimeout(function () {
request = jasmine.Ajax.requests.mostRecent();
expect(request.timeout).toBe(1000);
done();
}, 0);
});
});