pickle-jar 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -24
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -42,7 +42,8 @@ In order to run the features and their steps, a test runner entry point must be
42
42
  Create a file named `runner.ts` in the `<rootDir>/test` directory:
43
43
 
44
44
  ```ts
45
- import {StepDefinition, testRunner, FeatureContext} from "pickle-jar";
45
+ import {workerData} from "worker_threads";
46
+ import {StepDefinition, testRunner} from "../src";
46
47
 
47
48
  interface World {
48
49
  password: string | undefined;
@@ -63,20 +64,11 @@ const stepDefinitions: StepDefinition<World>[] = [{
63
64
  }
64
65
  }];
65
66
 
66
- // This function is called before each feature file is processed
67
- // It can be used to initialize the World object
68
- // The World object is passed to each step and allows sharing values from one step to another
69
- // The FeatureContext object contains information about the feature file being processed
70
- function worldFactory(featureContext: FeatureContext): World {
71
- const world: World = {
72
- password: undefined,
73
- grantedAccess: false
74
- }
75
- return world;
67
+ const world: World = {
68
+ password: undefined,
69
+ grantedAccess: false
76
70
  }
77
-
78
-
79
- testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, worldFactory);
71
+ testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, world);
80
72
  ```
81
73
 
82
74
  The test runner file defines the World object structure. This object is passed to each step and allows sharing values from one step to another.
@@ -112,7 +104,8 @@ Feature: Logging in
112
104
  ```
113
105
  ### `runner.ts` steps:
114
106
  ```ts
115
- import {StepDefinition, testRunner, FeatureContext} from "pickle-jar";
107
+ import {workerData} from "worker_threads";
108
+ import {StepDefinition, testRunner} from "../src";
116
109
 
117
110
  interface World {
118
111
  password: string | undefined;
@@ -133,16 +126,11 @@ const stepDefinitions: StepDefinition<World>[] = [{
133
126
  }
134
127
  }];
135
128
 
136
- function worldFactory(featureContext: FeatureContext): World {
137
- const world: World = {
138
- password: undefined,
139
- grantedAccess: false
140
- }
141
- return world;
129
+ const world: World = {
130
+ password: undefined,
131
+ grantedAccess: false
142
132
  }
143
-
144
-
145
- testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, worldFactory);
133
+ testRunner<World>(`${__dirname}/features/**/*.feature`, stepDefinitions, world);
146
134
  ```
147
135
 
148
136
  ## Running scenario outlines
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pickle-jar",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": "git@github0.com:nseba/pickle-jar.git",