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 { snapshot } = require('@ekino/veggies')
defineSupportCode(({ setWorldConstructor }) => {
setWorldConstructor(function() {
snapshot.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 { snapshot } = require('@ekino/veggies')
defineSupportCode(({ setWorldConstructor }) => {
setWorldConstructor(function() {
snapshot.extendWorld(this)
})
})
snapshot.install(defineSupportCode)