Global

Methods

countNestedProperties(object) → {number}

Count object properties including nested objects ones. If a property is an object, its key is ignored.
Source:
Parameters:
Name Type Description
object Object
Returns:
Type:
number
Example
Helper.countNestedProperties({
    a: true,
    b: true,
    c: true,
})
// => 3
Helper.countNestedProperties({
    a: true,
    b: true,
    c: {
        a: true,
        b: true,
    },
})
// => 4 (c is ignored because it's a nested object)

hasExtension(world, extensionId) → {boolean}

Checks if an extension were registered.
Source:
Parameters:
Name Type Description
world Object Cucumber world object
extensionId string Unique veggies extension identifier
Returns:
Type:
boolean

module:extensions/Cli/Cli() → {Cli}

Create a new isolated Cli
Source:
Returns:
Type:
Cli

module:extensions/fixtures/FixturesLoader() → {FixturesLoader}

Create a new isolated fixtures loader
Source:
Returns:
Type:
FixturesLoader

module:extensions/httpApi/client() → {HttpApiClient}

Create a new isolated http api client
Source:
Returns:
Type:
HttpApiClient

module:extensions/snapshot/dedent(text) → {string}

Used to remove indentation from a text. Usefull with multine string in backticks. Two way to use it : ` My text Another line Another line again ` the result text will be : "My text Another line Another line again" In this case, alignment is done on the length of the first character that is not a space or a tab of all lines Or Another way : ` """ My text Another line Another line again """ ` the result text will be : " My text Another line Another line again" In this case, alignment is donne on the spaces or tab before """ Warning : First line and last line will always be ignored
Source:
Parameters:
Name Type Description
text string
Returns:
Type:
string

module:extensions/snapshot/Snapshot() → {Snapshot}

Create a new isolated Snapshot module
Source:
Returns:
Type:
Snapshot

module:extensions/state/State() → {State}

Create a new isolated state
Source:
Returns:
Type:
State

mustGetResponse(client)

Ensures there's a response available and returns it.
Source:
Parameters:
Name Type Description
client Object

registerExtension(world, extensionId)

Registers an extension.
Source:
Parameters:
Name Type Description
world Object Cucumber world object
extensionId string Unique veggies extension identifier