Switch to ESM
This commit is contained in:
@ -4,6 +4,9 @@ import axios from 'axios'
|
||||
When('I request the same resource twice', async function () {
|
||||
const url = 'http://localhost:8080/'
|
||||
|
||||
this.first = await axios.request(url).data
|
||||
this.second = await axios.request(url).data
|
||||
const firstResponse = await axios.request(url)
|
||||
this.first = firstResponse.data
|
||||
|
||||
const secondResponse = await axios.request(url)
|
||||
this.second = secondResponse.data
|
||||
})
|
||||
|
@ -21,5 +21,9 @@ When('I request the same resource three times', function () {
|
||||
|
||||
Then('the responses should be the same', function () {
|
||||
expect(this.first).to.equal(this.second)
|
||||
|
||||
if (this.third === undefined) {
|
||||
return
|
||||
}
|
||||
expect(this.second).to.equal(this.third)
|
||||
})
|
||||
|
Reference in New Issue
Block a user