1.1.3 • Published 4 years ago

@ofm/ajax v1.1.3

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

ajax

import { initAjax, ajax } from '../src/index';
import mock from '../src/mock';

describe('test ajax', () => {
    test('initAjax', async () => {
        const baseURL = 'https://some-domain.com/api';
        initAjax({
            baseURL,
        });
        mock.onGet('/login').reply(200, { isSuccess: true });
        const response = await ajax.get('/login');
        expect(response.config.baseURL).toBe(baseURL);
        expect(response.data).toEqual({ isSuccess: true });
    });
});
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago