Skip to content

Instantly share code, notes, and snippets.

@qunabu
Created November 26, 2020 09:22
Show Gist options
  • Save qunabu/c29e9380b92ea014cdaa501eab991960 to your computer and use it in GitHub Desktop.
Save qunabu/c29e9380b92ea014cdaa501eab991960 to your computer and use it in GitHub Desktop.
Test integracyjny
// app
const request = require("supertest");
const app = require("express")();
app.get("/user", (req, res) => res.status(200).json({ name: "john" }));
// TEST. framework jest
request(app)
.get("/user")
.expect("Content-Type", /json/)
.expect(200) // http code
.then((response) => assert(response.body.name, "john"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment