1
0

Use node assertions as standard solution

This commit is contained in:
2025-07-16 16:39:09 +02:00
parent ef41c7d788
commit decd8e9e3d
18 changed files with 1789 additions and 6069 deletions

View File

@@ -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)
})

View File

@@ -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 () {