@cdxoo/axios-test-wrapper
v0.0.2
Published
one-line axios agent setup for test automation of express/koa style apps
Downloads
38
Readme
@cdxoo/axios-test-wrapper
one-line axios agent setup for test automation of express/koa style apps
Installation
npm install --save @cdxoo/axios-test-wrapper
Resources
Usage
// TDL; DR
const wrap = require('@cdxoo/axios-test-wrapper')
const [ agent, server ] = wrap(app, { /* axios options except baseURL */ })
const express = require('express')
const wrap = require('@cdxoo/axios-test-wrapper')
const app = express()
app.get('/', (req, res) => {
res.status(200).json({ name: 'john' })
})
const [ agent, server ] = wrap(app, { /* axios options except baseURL */ })
await agent.get('/');
await agent.get('/');
await agent.get('/');
server.close();