Modern HTTP expectation library inspired in supertest
This library is a modern implementation of supertest, typescript-first and promise first for the modern ages. Right now it's usage is restricted to jest.
Install tepper as an npm module and save it to your package.json file as a development dependency:
npm install --save-dev tepper
You may pass an http.Server
, or a Function
to tepper()
- if the server is not
already listening for connections then it is bound to an ephemeral port for you so
there is no need to keep track of ports.
import tepper from "tepper"
import express from "express"
const app = express();
app.get('/user', (req, res) => {
res.status(200).json({ name: 'john' });
});
const { body } = await tepper(app)
.get('/user')
.expect(200)
.run();
console.log(body)
Inspired by supertest.
MIT