Tests failed on receive a response -The "url" argument must be of type string. Received undefined #131
-
I have :
Test failed
Currently I use mix of approaches. So I have :
or
Its works, but I'm curious what is a difference. Especially, I need re-initial spec each time |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The method const spec_one = spec();
const spec_two = spec(); The method await spec().get('/api/users').expectStatus(200).toss();
await spec().get('/api/projects/p1').expectStatus(404).toss(); In your step definitions file, you have created an empty spec and running without defining any request details. When('I receive a response', async () => {
await spec().toss(); // empty spec, this will throw an error
}); |
Beta Was this translation helpful? Give feedback.
The method
spec
will create an instance through which we can make a single request. Please refer this for more usage details.The method
toss
will execute the spec and returns a promise. Please refer this for more usage details.In your step definitions file, you have created an empty spec and running without defining any request details.