@cdxoo/axios-test-wrapper

0.0.2 • Public • Published

@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();

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @cdxoo/axios-test-wrapper

Weekly Downloads

12

Version

0.0.2

License

MIT

Unpacked Size

6.66 kB

Total Files

7

Last publish

Collaborators

  • cdxoo