Skip to content

Hexlet/jest-supertest-matchers

Repository files navigation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.

See most active contributors on hexlet-friends.

jest-supertest-matchers

Github Actions

Jest plugin for testing HTTP status code.

Setup

npm i jest-supertest-matchers
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

$ make test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published