Use node assertions as standard solution
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Given, When, Then } from '@cucumber/cucumber'
|
||||
import { expect } from 'chai'
|
||||
import assert from 'node:assert/strict'
|
||||
import axios from 'axios'
|
||||
|
||||
When('I request the same resource three times', function () {
|
||||
@@ -20,10 +20,10 @@ When('I request the same resource three times', function () {
|
||||
})
|
||||
|
||||
Then('the responses should be the same', function () {
|
||||
expect(this.first).to.equal(this.second)
|
||||
assert.equal(this.first, this.second)
|
||||
|
||||
if (this.third === undefined) {
|
||||
return
|
||||
}
|
||||
expect(this.second).to.equal(this.third)
|
||||
assert.equal(this.second, this.third)
|
||||
})
|
||||
|
@@ -1,16 +1,13 @@
|
||||
import { BeforeAll, AfterAll } from '@cucumber/cucumber'
|
||||
import express from 'express'
|
||||
import { createServer } from 'node:http'
|
||||
|
||||
let server
|
||||
|
||||
BeforeAll(function () {
|
||||
const app = express()
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Alea iacta est')
|
||||
server = createServer(function (request, response) {
|
||||
response.end('Alea iacta est')
|
||||
})
|
||||
|
||||
server = app.listen(8080)
|
||||
server.listen(8080)
|
||||
})
|
||||
|
||||
AfterAll(function () {
|
||||
|
Reference in New Issue
Block a user