Parkin - Gherkin Parser
Feature
@add @world Feature: Add to world As a math wiz In order to show my math skills I want to add a number to the world Scenario: Add a number to the world.number property Given I have 1 as "number" When I add 1 to "number" Then I expect "number" to be 2
Definitions
Given("I have {int} as {string}", (num, str, ctx) => { const { world } = ctx world.number = num }) When("I add {int} to {string}", (num, str, ctx) => { const { world } = ctx world.number = world.number + num }) Then("I expect {string} to be {int}", (str, num, ctx) => { const { world } = ctx alert(`world.number (${world.number}) is equal to num (${num})? \n` + (world.number === num)) })
Run Feature
Open the inspector to see logs