https://github.com/hexlet/jest-supertest-matchers
https://github.com/hexlet/jest-supertest-matchers
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet/jest-supertest-matchers
- Owner: Hexlet
- Created: 2016-11-17T19:12:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T19:52:06.000Z (almost 2 years ago)
- Last Synced: 2025-06-28T09:42:28.359Z (12 months ago)
- Language: JavaScript
- Size: 382 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##
[](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=nodejs-package)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=nodejs-package).
##
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).
# jest-supertest-matchers
[](../../actions?query=workflow%3A"CI")
Jest plugin for testing HTTP status code.
## Setup
```sh
npm i jest-supertest-matchers
```
```javascript
import app from '../app';
import matchers from 'jest-supertest-matchers';
import request from 'supertest';
// inside tests
beforeAll(() => {
expect.extend(matchers);
});
it('example', async () => {
const res = await request(app).get('/');
expect(res).toHaveHTTPStatus(200);
});
```
## Run tests
```sh
$ make test
```