Releases: dnotes/quickpickle
[email protected]
@quickpickle/[email protected]
[email protected]
Minor Changes
-
2611f1d: Added support for custom parameter types, exactly as in CucumberJS.
A simple example:// Step definition file defineParameterType({ name: "updown", regexp: /(up|down)/, }); Given("a number {int}", (world, num) => { world.number = num; }); When("the number goes {updown} {int}", (world, updown, num) => { if (updown === "up") world.number += num; else world.number -= num; }); Then("the number should be {int}", (world, num) => { expect(world.number).toBe(num); });
Feature: Custom parameter types Scenario: The number Given a number 4 When the number goes up 5 Then the number should be 9
Patch Changes
@quickpickle/[email protected]
[email protected]
Patch Changes
- 3241e3e: remove console.log()s. /oops
@quickpickle/[email protected]
Patch Changes
- Updated dependencies [3241e3e]
[email protected]
Patch Changes
-
a5742b4: Fix tagged hooks to match @cucumber/cucumber implementation.
Tagged hooks are hooks that only run in the context of certain tags;
for example, a BeforeAll hook that only starts the server for
Features tagged with "@server".This change also adds info about the Feature to the "common" variable.
@quickpickle/[email protected]
Patch Changes
- Updated dependencies [a5742b4]
[email protected]
Patch Changes
-
ffa86bf: Added common variable should to BeforeAll and AfterAll hooks.
In your support files, you can get or set variables that should be
common (shared) across all the tests in the Feature file.In general it is not good testing practice to use this for anything
other than setup and teardown; for example, you might start a server
and save the port in BeforeAll, then tear it down in AfterAll.Here is a ridiculous example demonstrating the functionality:
import { BeforeAll, AfterAll, AfterStep } from "quickpickle"; BeforeAll(async (common) => { common.totalSteps = 0; }); AfterStep(async (world) => { world.common.totalSteps++; }); AfterAll(async (common) => { expect(common.totalSteps).not.toBeFalsy(); });
-
dee9d4b: Fixed errors in the hook implementations.
@quickpickle/[email protected]
Patch Changes
-
ffa86bf: Added common variable should to BeforeAll and AfterAll hooks.
In your support files, you can get or set variables that should be
common (shared) across all the tests in the Feature file.In general it is not good testing practice to use this for anything
other than setup and teardown; for example, you might start a server
and save the port in BeforeAll, then tear it down in AfterAll.Here is a ridiculous example demonstrating the functionality:
import { BeforeAll, AfterAll, AfterStep } from "quickpickle"; BeforeAll(async (common) => { common.totalSteps = 0; }); AfterStep(async (world) => { world.common.totalSteps++; }); AfterAll(async (common) => { expect(common.totalSteps).not.toBeFalsy(); });
-
Updated dependencies [ffa86bf]
-
Updated dependencies [dee9d4b]