Questions tagged [supertest-as-promised]
4 questions
2
votes
2 answers
expect is not defined in supertest-as-promised
When I used bellow code the error shown expect is not defined (inside of then )
Documentation link
it("should return error", function () {
return request(app).get("/verify")
.expect(200)
.then(function (res) {
return…

Shaishab Roy
- 16,335
- 7
- 50
- 68
0
votes
1 answer
Argument type string is not assignable to parameter type "set-cookie"
I try to do a GET if a error occurs in a previous POST with supertest. The problem is that I am unable to use GET.
This is my code:
bookId = await request(app).post("/books/add-one-book").send({
"name":"bookTest",
…

mathdx
- 45
- 6
0
votes
1 answer
testing multiple http request using mocha
I've been trying to solve this issue for days;
create the test for this case using mocha:
app.post('/approval', function(req, response){
request.post('https://git.ecommchannel.com/api/v4/users/' + req.body.content.id + '/' + req.body.content.state +…

mile
- 3
- 5
0
votes
1 answer
What is Expect function to validate schema in JEST and Supertest?
like in chakram testing expect(WallObject).to.have.schema(expectedSchema). Similarly which function is there in Jest? I am using jest with supertest.

Nikita S
- 139
- 2
- 11