summaryrefslogtreecommitdiff
path: root/reuse/features/steps/lodash.js
blob: 63092e1f448dfd5960564369efe5290f304fec4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Before, Given, Then } from 'cucumber'
import { expect } from 'chai'
import _ from 'lodash'

function step (name) {
  this.names.push(name)
}

Given('a person with a first name', _.partial(step, 'John'))
Given('a person with the first name {word}', step)

Then('the first names are collected by the same function', function () {
  expect(this.names).to.have.lengthOf(2)
  expect(this.names).to.include.members(['John', 'Jack'])
})