You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the The README documentation of an async test against a mockserver and trying to apply that to remote API I'm finding it doesn't run the assertions (doesn't await?).
If I modify that to talk to a remote API like the demo Swagger Petstore API it doesn't await on the expects so it will pass regardless of the expect
it('pet store test',asyncfunction({supertest}){constreq=awaitsupertest.request('https://petstore.swagger.io/v2').get('/store/inventory').set('Accept','application/json').expect(200)// For example, if I change this to 400 it will still pass.expect('Content-Type',/json/);});
If I instead use a non-async pattern it correctly checks the assertions
it('pet store test2',function({supertest}){supertest.request('https://petstore.swagger.io/v2').get('/store/inventory/').expect(200)// If I change to 400 it will fail as expected.expect('Content-Type',/json/).end(function(){console.log('done');});});
The text was updated successfully, but these errors were encountered:
Following the The README documentation of an async test against a mockserver and trying to apply that to remote API I'm finding it doesn't run the assertions (doesn't await?).
Here is the example from the README
If I modify that to talk to a remote API like the demo Swagger Petstore API it doesn't await on the expects so it will pass regardless of the expect
If I instead use a non-async pattern it correctly checks the assertions
The text was updated successfully, but these errors were encountered: