1
0
cucumber-js-demo/reuse/features/steps/ramda.js
2024-12-20 15:03:16 +01:00

16 lines
465 B
JavaScript

import { Before, Given, Then } from '@cucumber/cucumber'
import { expect } from 'chai'
import R from 'ramda'
function step (name) {
this.names.push(name)
}
Given('a person with a last name', R.partial(step, ['Junior']))
Given('a person with the last name {word}', R.partial(step, []))
Then('the last names are collected by the same function', function () {
expect(this.names).to.have.lengthOf(2)
expect(this.names).to.include.members(['Junior', 'Doe'])
})