1
0

reuse: Apply function with Ramda and Lodash

This commit is contained in:
2019-01-03 06:11:13 +01:00
parent 54fcfda40a
commit 48a1f3756b
7 changed files with 78 additions and 29 deletions

View File

@@ -0,0 +1,15 @@
import { Before, Given, Then } from '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'])
})