@lynxwall/cucumber-tsflow 6.0.2 → 6.1.1
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.
- package/bin/cucumber-tsflow +0 -0
- package/lib/behave.d.ts +1 -1
- package/lib/behave.js +27 -27
- package/lib/cli/argv-parser.d.ts +24 -24
- package/lib/cli/argv-parser.js +103 -103
- package/lib/cli/index.d.ts +22 -22
- package/lib/cli/index.js +100 -100
- package/lib/cli/load-configuration.d.ts +20 -20
- package/lib/cli/load-configuration.js +90 -93
- package/lib/cli/run.d.ts +1 -1
- package/lib/cli/run.js +47 -49
- package/lib/cucumber/binding-decorator.d.ts +10 -10
- package/lib/cucumber/binding-decorator.js +180 -180
- package/lib/cucumber/binding-registry.d.ts +82 -82
- package/lib/cucumber/binding-registry.js +215 -215
- package/lib/cucumber/hook-decorators.d.ts +46 -46
- package/lib/cucumber/hook-decorators.js +102 -102
- package/lib/cucumber/managed-scenario-context.d.ts +21 -21
- package/lib/cucumber/managed-scenario-context.js +95 -95
- package/lib/cucumber/message-collector.d.ts +81 -81
- package/lib/cucumber/message-collector.js +250 -250
- package/lib/cucumber/parallel/coordinator.d.ts +79 -79
- package/lib/cucumber/parallel/coordinator.js +246 -246
- package/lib/cucumber/parallel/run-worker.d.ts +1 -1
- package/lib/cucumber/parallel/run-worker.js +31 -31
- package/lib/cucumber/parallel/worker.d.ts +30 -30
- package/lib/cucumber/parallel/worker.js +103 -103
- package/lib/cucumber/run-cucumber.d.ts +14 -14
- package/lib/cucumber/run-cucumber.js +117 -117
- package/lib/cucumber/runtime.d.ts +25 -25
- package/lib/cucumber/runtime.js +39 -39
- package/lib/cucumber/step-definition-decorators.d.ts +24 -24
- package/lib/cucumber/step-definition-decorators.js +91 -91
- package/lib/cucumber/utils.d.ts +16 -16
- package/lib/cucumber/utils.js +77 -77
- package/lib/esnode.js +18 -18
- package/lib/esvue.d.ts +1 -1
- package/lib/esvue.js +40 -40
- package/lib/formatters/behave-json-formatter.d.ts +49 -49
- package/lib/formatters/behave-json-formatter.js +74 -74
- package/lib/formatters/tsflow-snippet-syntax.d.ts +9 -9
- package/lib/formatters/tsflow-snippet-syntax.js +89 -89
- package/lib/gherkin/configuration.d.ts +30 -30
- package/lib/gherkin/configuration.js +26 -26
- package/lib/gherkin/gherkin-feature.d.ts +28 -28
- package/lib/gherkin/gherkin-feature.js +353 -333
- package/lib/gherkin/gherkin-manager.d.ts +29 -29
- package/lib/gherkin/gherkin-manager.js +143 -114
- package/lib/gherkin/models.d.ts +46 -45
- package/lib/gherkin/models.js +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +22 -22
- package/lib/snippet.d.ts +1 -1
- package/lib/snippet.js +27 -27
- package/lib/transpilers/esbuild-transpiler.d.ts +4 -4
- package/lib/transpilers/esbuild-transpiler.js +18 -18
- package/lib/transpilers/esbuild.d.ts +12 -12
- package/lib/transpilers/esbuild.js +54 -54
- package/lib/transpilers/vue-sfc/compiler.d.ts +7 -7
- package/lib/transpilers/vue-sfc/compiler.js +21 -21
- package/lib/transpilers/vue-sfc/index.d.ts +23 -23
- package/lib/transpilers/vue-sfc/index.js +46 -46
- package/lib/transpilers/vue-sfc/main.d.ts +8 -8
- package/lib/transpilers/vue-sfc/main.js +247 -247
- package/lib/transpilers/vue-sfc/script.d.ts +5 -5
- package/lib/transpilers/vue-sfc/script.js +41 -41
- package/lib/transpilers/vue-sfc/template.d.ts +8 -8
- package/lib/transpilers/vue-sfc/template.js +101 -101
- package/lib/transpilers/vue-sfc/types.d.ts +55 -55
- package/lib/transpilers/vue-sfc/types.js +2 -2
- package/lib/transpilers/vue-sfc/utils/descriptorCache.d.ts +13 -13
- package/lib/transpilers/vue-sfc/utils/descriptorCache.js +67 -67
- package/lib/transpilers/vue-sfc/utils/error.d.ts +3 -3
- package/lib/transpilers/vue-sfc/utils/error.js +22 -22
- package/lib/transpilers/vue-sfc/utils/query.d.ts +13 -13
- package/lib/transpilers/vue-sfc/utils/query.js +35 -35
- package/lib/tsnode.js +17 -17
- package/lib/tsvue.d.ts +1 -1
- package/lib/tsvue.js +39 -39
- package/lib/types/scenario-context.d.ts +16 -16
- package/lib/types/scenario-context.js +17 -17
- package/lib/types/scenario-info.d.ts +16 -16
- package/lib/types/scenario-info.js +22 -22
- package/lib/types/step-binding-flags.d.ts +53 -53
- package/lib/types/step-binding-flags.js +58 -58
- package/lib/types/step-binding.d.ts +50 -50
- package/lib/types/step-binding.js +17 -17
- package/lib/types/types.d.ts +21 -21
- package/lib/types/types.js +2 -2
- package/lib/utils/helpers.d.ts +6 -6
- package/lib/utils/helpers.js +17 -17
- package/lib/utils/logger.d.ts +3 -3
- package/lib/utils/logger.js +29 -29
- package/lib/utils/our-callsite.d.ts +27 -27
- package/lib/utils/our-callsite.js +72 -72
- package/lib/version.d.ts +1 -1
- package/lib/version.js +5 -5
- package/package.json +7 -7
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BindingRegistry = exports.DEFAULT_TAG = exports.DEFAULT_STEP_PATTERN = void 0;
|
|
7
|
-
const underscore_1 = __importDefault(require("underscore"));
|
|
8
|
-
const step_binding_1 = require("../types/step-binding");
|
|
9
|
-
/**
|
|
10
|
-
* Represents the default step pattern.
|
|
11
|
-
*/
|
|
12
|
-
exports.DEFAULT_STEP_PATTERN = '/.*/';
|
|
13
|
-
/**
|
|
14
|
-
* Represents the default tag.
|
|
15
|
-
*/
|
|
16
|
-
exports.DEFAULT_TAG = '*';
|
|
17
|
-
/**
|
|
18
|
-
* A metadata registry that captures information about bindings and their bound step bindings.
|
|
19
|
-
*/
|
|
20
|
-
class BindingRegistry {
|
|
21
|
-
_bindings = new Map();
|
|
22
|
-
_targetBindings = new Map();
|
|
23
|
-
/**
|
|
24
|
-
* Gets the binding registry singleton.
|
|
25
|
-
*
|
|
26
|
-
* @returns A [[BindingRegistry]].
|
|
27
|
-
*/
|
|
28
|
-
static get instance() {
|
|
29
|
-
const BINDING_REGISTRY_SLOTNAME = '__CUCUMBER_TSFLOW_BINDINGREGISTRY';
|
|
30
|
-
const registry = global[BINDING_REGISTRY_SLOTNAME];
|
|
31
|
-
if (!registry) {
|
|
32
|
-
global[BINDING_REGISTRY_SLOTNAME] = new BindingRegistry();
|
|
33
|
-
}
|
|
34
|
-
return registry || global[BINDING_REGISTRY_SLOTNAME];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Updates the binding registry with information about the context types required by a
|
|
38
|
-
* binding class.
|
|
39
|
-
*
|
|
40
|
-
* @param targetPrototype The class representing the binding (constructor function).
|
|
41
|
-
* @param contextTypes An array of [[ContextType]] that define the types of objects that
|
|
42
|
-
* should be injected into the binding class during a scenario execution.
|
|
43
|
-
*/
|
|
44
|
-
registerContextTypesForTarget(targetPrototype, contextTypes) {
|
|
45
|
-
if (!contextTypes) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
let targetDecorations = this._targetBindings.get(targetPrototype);
|
|
49
|
-
if (!targetDecorations) {
|
|
50
|
-
targetDecorations = {
|
|
51
|
-
stepBindings: [],
|
|
52
|
-
contextTypes: []
|
|
53
|
-
};
|
|
54
|
-
this._targetBindings.set(targetPrototype, targetDecorations);
|
|
55
|
-
}
|
|
56
|
-
targetDecorations.contextTypes = contextTypes;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Retrieves the context types that have been registered for a given binding class.
|
|
60
|
-
*
|
|
61
|
-
* @param targetPrototype The class representing the binding (constructor function).
|
|
62
|
-
*
|
|
63
|
-
* @returns An array of [[ContextType]] that have been registered for the specified
|
|
64
|
-
* binding class.
|
|
65
|
-
*/
|
|
66
|
-
getContextTypesForTarget(targetPrototype) {
|
|
67
|
-
const targetBinding = this._targetBindings.get(targetPrototype);
|
|
68
|
-
if (!targetBinding) {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
return targetBinding.contextTypes;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Updates the binding registry indexes with a step binding.
|
|
75
|
-
*
|
|
76
|
-
* @param stepBinding The step binding that is to be registered with the binding registry.
|
|
77
|
-
*/
|
|
78
|
-
registerStepBinding(stepBinding) {
|
|
79
|
-
if (!stepBinding.tags) {
|
|
80
|
-
stepBinding.tags = exports.DEFAULT_TAG;
|
|
81
|
-
}
|
|
82
|
-
if (stepBinding.tags !== exports.DEFAULT_TAG && !stepBinding.tags.startsWith('@')) {
|
|
83
|
-
// tslint:disable-next-line:no-console
|
|
84
|
-
console.log('tag should start with @; tsflow has stopped to automatically prepend @ for you.');
|
|
85
|
-
}
|
|
86
|
-
const stepPattern = stepBinding.stepPattern
|
|
87
|
-
? stepBinding.stepPattern.toString()
|
|
88
|
-
: exports.DEFAULT_STEP_PATTERN;
|
|
89
|
-
let tagMap = this._bindings.get(stepPattern);
|
|
90
|
-
if (!tagMap) {
|
|
91
|
-
tagMap = new Map();
|
|
92
|
-
this._bindings.set(stepPattern, tagMap);
|
|
93
|
-
}
|
|
94
|
-
let stepBindings = tagMap.get(stepBinding.tags);
|
|
95
|
-
if (!stepBindings) {
|
|
96
|
-
stepBindings = [];
|
|
97
|
-
tagMap.set(stepBinding.tags, stepBindings);
|
|
98
|
-
}
|
|
99
|
-
if (!stepBindings.some(b => isSameStepBinding(stepBinding, b))) {
|
|
100
|
-
stepBindings.push(stepBinding);
|
|
101
|
-
}
|
|
102
|
-
// Index the step binding for the target
|
|
103
|
-
let targetBinding = this._targetBindings.get(stepBinding.targetPrototype);
|
|
104
|
-
if (!targetBinding) {
|
|
105
|
-
targetBinding = {
|
|
106
|
-
stepBindings: [],
|
|
107
|
-
contextTypes: []
|
|
108
|
-
};
|
|
109
|
-
this._targetBindings.set(stepBinding.targetPrototype, targetBinding);
|
|
110
|
-
}
|
|
111
|
-
if (!targetBinding.stepBindings.some(b => isSameStepBinding(stepBinding, b))) {
|
|
112
|
-
targetBinding.stepBindings.push(stepBinding);
|
|
113
|
-
}
|
|
114
|
-
function isSameStepBinding(a, b) {
|
|
115
|
-
return (a.callsite.filename === b.callsite.filename &&
|
|
116
|
-
a.callsite.lineNumber === b.callsite.lineNumber &&
|
|
117
|
-
String(a.tags) === String(b.tags) &&
|
|
118
|
-
String(a.stepPattern) === String(b.stepPattern));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Retrieves the step bindings that have been registered for a given binding class.
|
|
123
|
-
*
|
|
124
|
-
* @param targetPrototype The class representing the binding (constructor function).
|
|
125
|
-
*
|
|
126
|
-
* @returns An array of [[StepBinding]] objects that have been registered for the specified
|
|
127
|
-
* binding class.
|
|
128
|
-
*/
|
|
129
|
-
getStepBindingsForTarget(targetPrototype) {
|
|
130
|
-
const targetBinding = this._targetBindings.get(targetPrototype);
|
|
131
|
-
if (!targetBinding) {
|
|
132
|
-
return [];
|
|
133
|
-
}
|
|
134
|
-
return targetBinding.stepBindings;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Retrieves the step bindings for a given step pattern and collection of tag names.
|
|
138
|
-
*
|
|
139
|
-
* @param stepPattern The step pattern to search.
|
|
140
|
-
* @param tags An array of [[TagName]] to search.
|
|
141
|
-
*
|
|
142
|
-
* @returns An array of [[StepBinding]] that map to the given step pattern and set of tag names.
|
|
143
|
-
*/
|
|
144
|
-
getStepBindings(stepPattern, tags) {
|
|
145
|
-
const tagMap = this._bindings.get(stepPattern);
|
|
146
|
-
if (!tagMap) {
|
|
147
|
-
return [];
|
|
148
|
-
}
|
|
149
|
-
const matchingStepBindings = this.mapTagNamesToStepBindings(tags, tagMap);
|
|
150
|
-
if (matchingStepBindings.length > 0) {
|
|
151
|
-
return matchingStepBindings;
|
|
152
|
-
}
|
|
153
|
-
return this.mapTagNamesToStepBindings(['*'], tagMap);
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Updates the SupportCodeLibrary from Cucumber with
|
|
157
|
-
* callsite information from tsflow bindings
|
|
158
|
-
* @param library
|
|
159
|
-
* @returns
|
|
160
|
-
*/
|
|
161
|
-
updateSupportCodeLibrary = (library) => {
|
|
162
|
-
this._targetBindings.forEach(binding => {
|
|
163
|
-
binding.stepBindings.forEach(stepBinding => {
|
|
164
|
-
let cucumberDefinition = undefined;
|
|
165
|
-
switch (stepBinding.bindingType) {
|
|
166
|
-
case step_binding_1.StepBindingFlags.beforeAll:
|
|
167
|
-
cucumberDefinition = library.beforeTestRunHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
168
|
-
break;
|
|
169
|
-
case step_binding_1.StepBindingFlags.before:
|
|
170
|
-
cucumberDefinition = library.beforeTestCaseHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
171
|
-
break;
|
|
172
|
-
case step_binding_1.StepBindingFlags.beforeStep:
|
|
173
|
-
cucumberDefinition = library.beforeTestStepHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
174
|
-
break;
|
|
175
|
-
case step_binding_1.StepBindingFlags.given:
|
|
176
|
-
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
177
|
-
break;
|
|
178
|
-
case step_binding_1.StepBindingFlags.when:
|
|
179
|
-
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
180
|
-
break;
|
|
181
|
-
case step_binding_1.StepBindingFlags.then:
|
|
182
|
-
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
183
|
-
break;
|
|
184
|
-
case step_binding_1.StepBindingFlags.afterStep:
|
|
185
|
-
cucumberDefinition = library.afterTestStepHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
186
|
-
break;
|
|
187
|
-
case step_binding_1.StepBindingFlags.after:
|
|
188
|
-
cucumberDefinition = library.afterTestCaseHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
189
|
-
break;
|
|
190
|
-
case step_binding_1.StepBindingFlags.afterAll:
|
|
191
|
-
cucumberDefinition = library.afterTestRunHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
if (cucumberDefinition) {
|
|
195
|
-
cucumberDefinition.line = stepBinding.callsite.lineNumber;
|
|
196
|
-
cucumberDefinition.uri = stepBinding.callsite.filename;
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
return library;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* Maps an array of tag names to an array of associated step bindings.
|
|
204
|
-
*
|
|
205
|
-
* @param tags An array of [[TagName]].
|
|
206
|
-
* @param tagMap The map of [[TagName]] -> [[StepBinding]] to use when mapping.
|
|
207
|
-
*
|
|
208
|
-
* @returns An array of [[StepBinding]].
|
|
209
|
-
*/
|
|
210
|
-
mapTagNamesToStepBindings(tags, tagMap) {
|
|
211
|
-
const matchingStepBindings = underscore_1.default.flatten(underscore_1.default.map(tags, tag => tagMap.get(tag)));
|
|
212
|
-
return underscore_1.default.reject(matchingStepBindings, stepBinding => stepBinding === undefined);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
exports.BindingRegistry = BindingRegistry;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BindingRegistry = exports.DEFAULT_TAG = exports.DEFAULT_STEP_PATTERN = void 0;
|
|
7
|
+
const underscore_1 = __importDefault(require("underscore"));
|
|
8
|
+
const step_binding_1 = require("../types/step-binding");
|
|
9
|
+
/**
|
|
10
|
+
* Represents the default step pattern.
|
|
11
|
+
*/
|
|
12
|
+
exports.DEFAULT_STEP_PATTERN = '/.*/';
|
|
13
|
+
/**
|
|
14
|
+
* Represents the default tag.
|
|
15
|
+
*/
|
|
16
|
+
exports.DEFAULT_TAG = '*';
|
|
17
|
+
/**
|
|
18
|
+
* A metadata registry that captures information about bindings and their bound step bindings.
|
|
19
|
+
*/
|
|
20
|
+
class BindingRegistry {
|
|
21
|
+
_bindings = new Map();
|
|
22
|
+
_targetBindings = new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Gets the binding registry singleton.
|
|
25
|
+
*
|
|
26
|
+
* @returns A [[BindingRegistry]].
|
|
27
|
+
*/
|
|
28
|
+
static get instance() {
|
|
29
|
+
const BINDING_REGISTRY_SLOTNAME = '__CUCUMBER_TSFLOW_BINDINGREGISTRY';
|
|
30
|
+
const registry = global[BINDING_REGISTRY_SLOTNAME];
|
|
31
|
+
if (!registry) {
|
|
32
|
+
global[BINDING_REGISTRY_SLOTNAME] = new BindingRegistry();
|
|
33
|
+
}
|
|
34
|
+
return registry || global[BINDING_REGISTRY_SLOTNAME];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Updates the binding registry with information about the context types required by a
|
|
38
|
+
* binding class.
|
|
39
|
+
*
|
|
40
|
+
* @param targetPrototype The class representing the binding (constructor function).
|
|
41
|
+
* @param contextTypes An array of [[ContextType]] that define the types of objects that
|
|
42
|
+
* should be injected into the binding class during a scenario execution.
|
|
43
|
+
*/
|
|
44
|
+
registerContextTypesForTarget(targetPrototype, contextTypes) {
|
|
45
|
+
if (!contextTypes) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let targetDecorations = this._targetBindings.get(targetPrototype);
|
|
49
|
+
if (!targetDecorations) {
|
|
50
|
+
targetDecorations = {
|
|
51
|
+
stepBindings: [],
|
|
52
|
+
contextTypes: []
|
|
53
|
+
};
|
|
54
|
+
this._targetBindings.set(targetPrototype, targetDecorations);
|
|
55
|
+
}
|
|
56
|
+
targetDecorations.contextTypes = contextTypes;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves the context types that have been registered for a given binding class.
|
|
60
|
+
*
|
|
61
|
+
* @param targetPrototype The class representing the binding (constructor function).
|
|
62
|
+
*
|
|
63
|
+
* @returns An array of [[ContextType]] that have been registered for the specified
|
|
64
|
+
* binding class.
|
|
65
|
+
*/
|
|
66
|
+
getContextTypesForTarget(targetPrototype) {
|
|
67
|
+
const targetBinding = this._targetBindings.get(targetPrototype);
|
|
68
|
+
if (!targetBinding) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return targetBinding.contextTypes;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Updates the binding registry indexes with a step binding.
|
|
75
|
+
*
|
|
76
|
+
* @param stepBinding The step binding that is to be registered with the binding registry.
|
|
77
|
+
*/
|
|
78
|
+
registerStepBinding(stepBinding) {
|
|
79
|
+
if (!stepBinding.tags) {
|
|
80
|
+
stepBinding.tags = exports.DEFAULT_TAG;
|
|
81
|
+
}
|
|
82
|
+
if (stepBinding.tags !== exports.DEFAULT_TAG && !stepBinding.tags.startsWith('@')) {
|
|
83
|
+
// tslint:disable-next-line:no-console
|
|
84
|
+
console.log('tag should start with @; tsflow has stopped to automatically prepend @ for you.');
|
|
85
|
+
}
|
|
86
|
+
const stepPattern = stepBinding.stepPattern
|
|
87
|
+
? stepBinding.stepPattern.toString()
|
|
88
|
+
: exports.DEFAULT_STEP_PATTERN;
|
|
89
|
+
let tagMap = this._bindings.get(stepPattern);
|
|
90
|
+
if (!tagMap) {
|
|
91
|
+
tagMap = new Map();
|
|
92
|
+
this._bindings.set(stepPattern, tagMap);
|
|
93
|
+
}
|
|
94
|
+
let stepBindings = tagMap.get(stepBinding.tags);
|
|
95
|
+
if (!stepBindings) {
|
|
96
|
+
stepBindings = [];
|
|
97
|
+
tagMap.set(stepBinding.tags, stepBindings);
|
|
98
|
+
}
|
|
99
|
+
if (!stepBindings.some(b => isSameStepBinding(stepBinding, b))) {
|
|
100
|
+
stepBindings.push(stepBinding);
|
|
101
|
+
}
|
|
102
|
+
// Index the step binding for the target
|
|
103
|
+
let targetBinding = this._targetBindings.get(stepBinding.targetPrototype);
|
|
104
|
+
if (!targetBinding) {
|
|
105
|
+
targetBinding = {
|
|
106
|
+
stepBindings: [],
|
|
107
|
+
contextTypes: []
|
|
108
|
+
};
|
|
109
|
+
this._targetBindings.set(stepBinding.targetPrototype, targetBinding);
|
|
110
|
+
}
|
|
111
|
+
if (!targetBinding.stepBindings.some(b => isSameStepBinding(stepBinding, b))) {
|
|
112
|
+
targetBinding.stepBindings.push(stepBinding);
|
|
113
|
+
}
|
|
114
|
+
function isSameStepBinding(a, b) {
|
|
115
|
+
return (a.callsite.filename === b.callsite.filename &&
|
|
116
|
+
a.callsite.lineNumber === b.callsite.lineNumber &&
|
|
117
|
+
String(a.tags) === String(b.tags) &&
|
|
118
|
+
String(a.stepPattern) === String(b.stepPattern));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Retrieves the step bindings that have been registered for a given binding class.
|
|
123
|
+
*
|
|
124
|
+
* @param targetPrototype The class representing the binding (constructor function).
|
|
125
|
+
*
|
|
126
|
+
* @returns An array of [[StepBinding]] objects that have been registered for the specified
|
|
127
|
+
* binding class.
|
|
128
|
+
*/
|
|
129
|
+
getStepBindingsForTarget(targetPrototype) {
|
|
130
|
+
const targetBinding = this._targetBindings.get(targetPrototype);
|
|
131
|
+
if (!targetBinding) {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
return targetBinding.stepBindings;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Retrieves the step bindings for a given step pattern and collection of tag names.
|
|
138
|
+
*
|
|
139
|
+
* @param stepPattern The step pattern to search.
|
|
140
|
+
* @param tags An array of [[TagName]] to search.
|
|
141
|
+
*
|
|
142
|
+
* @returns An array of [[StepBinding]] that map to the given step pattern and set of tag names.
|
|
143
|
+
*/
|
|
144
|
+
getStepBindings(stepPattern, tags) {
|
|
145
|
+
const tagMap = this._bindings.get(stepPattern);
|
|
146
|
+
if (!tagMap) {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
const matchingStepBindings = this.mapTagNamesToStepBindings(tags, tagMap);
|
|
150
|
+
if (matchingStepBindings.length > 0) {
|
|
151
|
+
return matchingStepBindings;
|
|
152
|
+
}
|
|
153
|
+
return this.mapTagNamesToStepBindings(['*'], tagMap);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Updates the SupportCodeLibrary from Cucumber with
|
|
157
|
+
* callsite information from tsflow bindings
|
|
158
|
+
* @param library
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
updateSupportCodeLibrary = (library) => {
|
|
162
|
+
this._targetBindings.forEach(binding => {
|
|
163
|
+
binding.stepBindings.forEach(stepBinding => {
|
|
164
|
+
let cucumberDefinition = undefined;
|
|
165
|
+
switch (stepBinding.bindingType) {
|
|
166
|
+
case step_binding_1.StepBindingFlags.beforeAll:
|
|
167
|
+
cucumberDefinition = library.beforeTestRunHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
168
|
+
break;
|
|
169
|
+
case step_binding_1.StepBindingFlags.before:
|
|
170
|
+
cucumberDefinition = library.beforeTestCaseHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
171
|
+
break;
|
|
172
|
+
case step_binding_1.StepBindingFlags.beforeStep:
|
|
173
|
+
cucumberDefinition = library.beforeTestStepHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
174
|
+
break;
|
|
175
|
+
case step_binding_1.StepBindingFlags.given:
|
|
176
|
+
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
177
|
+
break;
|
|
178
|
+
case step_binding_1.StepBindingFlags.when:
|
|
179
|
+
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
180
|
+
break;
|
|
181
|
+
case step_binding_1.StepBindingFlags.then:
|
|
182
|
+
cucumberDefinition = library.stepDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
183
|
+
break;
|
|
184
|
+
case step_binding_1.StepBindingFlags.afterStep:
|
|
185
|
+
cucumberDefinition = library.afterTestStepHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
186
|
+
break;
|
|
187
|
+
case step_binding_1.StepBindingFlags.after:
|
|
188
|
+
cucumberDefinition = library.afterTestCaseHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
189
|
+
break;
|
|
190
|
+
case step_binding_1.StepBindingFlags.afterAll:
|
|
191
|
+
cucumberDefinition = library.afterTestRunHookDefinitions.find(s => s.options.cucumberKey === stepBinding.cucumberKey);
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
if (cucumberDefinition) {
|
|
195
|
+
cucumberDefinition.line = stepBinding.callsite.lineNumber;
|
|
196
|
+
cucumberDefinition.uri = stepBinding.callsite.filename;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
return library;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Maps an array of tag names to an array of associated step bindings.
|
|
204
|
+
*
|
|
205
|
+
* @param tags An array of [[TagName]].
|
|
206
|
+
* @param tagMap The map of [[TagName]] -> [[StepBinding]] to use when mapping.
|
|
207
|
+
*
|
|
208
|
+
* @returns An array of [[StepBinding]].
|
|
209
|
+
*/
|
|
210
|
+
mapTagNamesToStepBindings(tags, tagMap) {
|
|
211
|
+
const matchingStepBindings = underscore_1.default.flatten(underscore_1.default.map(tags, tag => tagMap.get(tag)));
|
|
212
|
+
return underscore_1.default.reject(matchingStepBindings, stepBinding => stepBinding === undefined);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.BindingRegistry = Bind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BbUM7UUFDckYsTUFBTSxvQkFBb0IsR0FBZ0Msb0JBQUMsQ0FBQyxPQUFPLENBQUMsb0JBQUMsQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFekcsT0FBTyxvQkFBQyxDQUFDLE1BQU0sQ0FBQyxvQkFBb0IsRUFBRSxXQUFXLENBQUMsRUFBRSxDQUFDLFdBQVcsS0FBSyxTQUFTLENBQWtCLENBQUM7SUFDbEcsQ0FBQztDQUNEO0FBN1BELDBDQTZQQyJ9
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A method decorator that marks the associated function as a 'Before All Scenario' step. The function is
|
|
3
|
-
* executed before all scenarios are executed.
|
|
4
|
-
*
|
|
5
|
-
* @param timeout Optional timeout in milliseconds
|
|
6
|
-
*/
|
|
7
|
-
export declare function beforeAll(timeout?: number): MethodDecorator;
|
|
8
|
-
/**
|
|
9
|
-
* A method decorator that marks the associated function as a 'Before Scenario' step. The function is
|
|
10
|
-
* executed before each scenario.
|
|
11
|
-
*
|
|
12
|
-
* @param tags Optional tag or tags associated with a scenario.
|
|
13
|
-
* @param timeout Optional timeout in milliseconds
|
|
14
|
-
*/
|
|
15
|
-
export declare function before(tags?: string, timeout?: number): MethodDecorator;
|
|
16
|
-
/**
|
|
17
|
-
* A method decorator that marks the associated function as a 'Before Step' step. The function is
|
|
18
|
-
* executed before each step.
|
|
19
|
-
*
|
|
20
|
-
* @param tags Optional tag or tags associated with a scenario.
|
|
21
|
-
* @param timeout Optional timeout in milliseconds
|
|
22
|
-
*/
|
|
23
|
-
export declare function beforeStep(tags?: string, timeout?: number): MethodDecorator;
|
|
24
|
-
/**
|
|
25
|
-
* A method decorator that marks the associated function as an 'After All Scenario' step. The function is
|
|
26
|
-
* executed after all scenarios are executed.
|
|
27
|
-
*
|
|
28
|
-
* @param timeout Optional timeout in milliseconds
|
|
29
|
-
*/
|
|
30
|
-
export declare function afterAll(timeout?: number): MethodDecorator;
|
|
31
|
-
/**
|
|
32
|
-
* A method decorator that marks the associated function as an 'After Scenario' step. The function is
|
|
33
|
-
* executed after each scenario.
|
|
34
|
-
*
|
|
35
|
-
* @param tags Optional tag or tags associated with a scenario.
|
|
36
|
-
* @param timeout Optional timeout in milliseconds
|
|
37
|
-
*/
|
|
38
|
-
export declare function after(tags?: string, timeout?: number): MethodDecorator;
|
|
39
|
-
/**
|
|
40
|
-
* A method decorator that marks the associated function as a 'After Step' step. The function is
|
|
41
|
-
* executed after each step.
|
|
42
|
-
*
|
|
43
|
-
* @param tags Optional tag or tags associated with a scenario.
|
|
44
|
-
* @param timeout Optional timeout in milliseconds
|
|
45
|
-
*/
|
|
46
|
-
export declare function afterStep(tags?: string, timeout?: number): MethodDecorator;
|
|
1
|
+
/**
|
|
2
|
+
* A method decorator that marks the associated function as a 'Before All Scenario' step. The function is
|
|
3
|
+
* executed before all scenarios are executed.
|
|
4
|
+
*
|
|
5
|
+
* @param timeout Optional timeout in milliseconds
|
|
6
|
+
*/
|
|
7
|
+
export declare function beforeAll(timeout?: number): MethodDecorator;
|
|
8
|
+
/**
|
|
9
|
+
* A method decorator that marks the associated function as a 'Before Scenario' step. The function is
|
|
10
|
+
* executed before each scenario.
|
|
11
|
+
*
|
|
12
|
+
* @param tags Optional tag or tags associated with a scenario.
|
|
13
|
+
* @param timeout Optional timeout in milliseconds
|
|
14
|
+
*/
|
|
15
|
+
export declare function before(tags?: string, timeout?: number): MethodDecorator;
|
|
16
|
+
/**
|
|
17
|
+
* A method decorator that marks the associated function as a 'Before Step' step. The function is
|
|
18
|
+
* executed before each step.
|
|
19
|
+
*
|
|
20
|
+
* @param tags Optional tag or tags associated with a scenario.
|
|
21
|
+
* @param timeout Optional timeout in milliseconds
|
|
22
|
+
*/
|
|
23
|
+
export declare function beforeStep(tags?: string, timeout?: number): MethodDecorator;
|
|
24
|
+
/**
|
|
25
|
+
* A method decorator that marks the associated function as an 'After All Scenario' step. The function is
|
|
26
|
+
* executed after all scenarios are executed.
|
|
27
|
+
*
|
|
28
|
+
* @param timeout Optional timeout in milliseconds
|
|
29
|
+
*/
|
|
30
|
+
export declare function afterAll(timeout?: number): MethodDecorator;
|
|
31
|
+
/**
|
|
32
|
+
* A method decorator that marks the associated function as an 'After Scenario' step. The function is
|
|
33
|
+
* executed after each scenario.
|
|
34
|
+
*
|
|
35
|
+
* @param tags Optional tag or tags associated with a scenario.
|
|
36
|
+
* @param timeout Optional timeout in milliseconds
|
|
37
|
+
*/
|
|
38
|
+
export declare function after(tags?: string, timeout?: number): MethodDecorator;
|
|
39
|
+
/**
|
|
40
|
+
* A method decorator that marks the associated function as a 'After Step' step. The function is
|
|
41
|
+
* executed after each step.
|
|
42
|
+
*
|
|
43
|
+
* @param tags Optional tag or tags associated with a scenario.
|
|
44
|
+
* @param timeout Optional timeout in milliseconds
|
|
45
|
+
*/
|
|
46
|
+
export declare function afterStep(tags?: string, timeout?: number): MethodDecorator;
|