axios-rest-api
Version:
Simple Axios wrapper for simple REST Api requests.
21 lines (18 loc) • 545 B
JavaScript
import Api from '../src';
describe('Проверить заголовки', () => {
let $api;
beforeEach(() => {
let resources = [];
resources.default = { };
$api = new Api(resources);
});
it('установить ключ', () => {
let api = $api.res();
api.auth('authkey');
api.setHeaders({content: 'first'});
expect(api.dumpAxiosConfig()).toEqual({headers: {
Authorization: 'Bearer authkey',
content: 'first',
}});
});
});