Home > Software design >  Nestjs getting 404 on e2e test but expected 400 (chai & supertest)
Nestjs getting 404 on e2e test but expected 400 (chai & supertest)

Time:05-28

Hello Fellow Programmers, i just bumped into a problem that would like to get another eyes into.

As im running e2e tests, in this function enter image description here

im getting this error enter image description here

Which seems odd, because when im testing on swagger or postman the request behaves as expected as you can see here enter image description here

this is my module on the test file

enter image description here

Do you happen to know what the solution might be?, let me know below :) Also, if you need more info just let me know and i'll update this question.

Already made sure that the address it's sending the request to is correct.

CodePudding user response:

Where do you set the authenticationBaseAPIPath? And can you try hard coding to path like in the curl request?

CodePudding user response:

Would it be possible that the server is not fully initialized when you run your API call? An asynchronous problem?

Look at that test template, maybe that would work? Sorry I cannot test, I'm on phone / vacation.

Test template : https://github.com/befabry/nest-car-value/blob/master/test/auth.e2e-spec.ts

  • Related