Toa Tomato
Create BDD with TDD. Primitive mocking library for cucumber.js.
Please note that this was originally created for internal use within the Toa project, and as such may not fully meet your specific needs or requirements.
Usage with Jest
const tomato = require('@toa.io/tomato')
const mock = { tomato }
jest.mock('@cucumber/cucumber', () => mock.tomato)
require('my-step-definitions')
const step = tomato.steps.Given('we have something')
it('should set foo to the context', () => {
const context = {}
step.call(context)
expect(context.foo).toBeDefined()
})
Acronyms
tomato.steps
exposes keywords as acronyms (Gi
, Wh
, etc.) to prevent IDE
code completion duplication.
const step = tomato.steps.Gi('we have something')