axios-with-cookies
Version:
Fork of axios-cookiejar-support with configurable http(s)-agent
25 lines (18 loc) • 533 B
text/typescript
import test from 'ava';
import axios from 'axios';
import { wrapper } from '../';
import { createTestServer } from './helpers';
test.before(() => {
wrapper(axios);
});
test.serial('should receive response correctly without cookiejar', async (t) => {
const { port } = await createTestServer([
(_req, res) => {
res.end('Hello World!');
},
]);
const { data, status } = await axios.get(`http://localhost:${port}`, { responseType: 'text' });
t.is(status, 200);
t.is(data, 'Hello World!');
t.plan(2);
});