extensions/Cli

Methods

(static) extendWorld(world)

Extends cucumber world object. Must be used inside customWorldConstructor.
Source:
Parameters:
Name Type Description
world Object The cucumber world object
Example
// /support/world.js

const { defineSupportCode } = require('cucumber')
const { state, cli } = require('@ekino/veggies')

defineSupportCode(({ setWorldConstructor }) => {
    setWorldConstructor(function() {
        state.extendWorld(this) // cli extension requires state extension
        cli.extendWorld(this)
    })
})

(static) install(define)

Installs the extension.
Source:
Parameters:
Name Type Description
define function The `defineSupportCode` helper from cucumber
Example
// /support/world.js

const { defineSupportCode } = require('cucumber')
const { state, cli } = require('@ekino/veggies')

defineSupportCode(({ setWorldConstructor }) => {
    setWorldConstructor(function() {
        state.extendWorld(this) // cli extension requires state extension
        cli.extendWorld(this)
    })
})

state.install(defineSupportCode)
cli.install(defineSupportCode)