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, fileSystem } = require('@ekino/veggies')
defineSupportCode(({ setWorldConstructor }) => {
setWorldConstructor(function() {
state.extendWorld(this) // cli extension requires state extension
cli.extendWorld(this) // fileSystem extension requires cli extension
fileSystem.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, fileSystem } = require('@ekino/veggies')
defineSupportCode(({ setWorldConstructor }) => {
setWorldConstructor(function() {
state.extendWorld(this) // cli extension requires state extension
cli.extendWorld(this) // fileSystem extension requires cli extension
fileSystem.extendWorld(this)
})
})
state.install(defineSupportCode)
cli.install(defineSupportCode)
fileSystem.install(defineSupportCode)