Created
November 26, 2020 09:22
-
-
Save qunabu/c29e9380b92ea014cdaa501eab991960 to your computer and use it in GitHub Desktop.
Test integracyjny
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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