🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

tepper

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tepper

Modern library for testing HTTP servers

1.2.0
latest
Source
npm
Version published
Weekly downloads
123
167.39%
Maintainers
1
Weekly downloads
 
Created
Source

Tepper

GitHub Workflow Status codecov npm MIT License PRs Welcome

Modern HTTP expectation library inspired in supertest

About

This library is a modern implementation of supertest, typescript-first and promise first for the modern ages. It supports jest and vitest.

Installation

Install tepper as an npm module and save it to your package.json file as a development dependency:

npm install --save-dev tepper

Example

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)

Notes

Inspired by supertest.

License

MIT

FAQs

Package last updated on 26 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts