Created
October 15, 2020 19:00
-
-
Save qunabu/32e7cd40acde20eebc902a48e83de874 to your computer and use it in GitHub Desktop.
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
it("should return `Hi ${user.username}`", async (done) => { | |
const token = await jwt(user.id); | |
await request(strapi.server) // app server is and instance of Class: http.Server | |
.get("/hi") | |
.set("Authorization", "Bearer " + token) | |
.expect(200) // Expect response http code 200 | |
.then((data) => { | |
expect(data.text).toBe(`Hi ${user.username}`); // expect the response welcome text | |
}); | |
done(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment