@lynxwall/cucumber-tsflow 6.0.0 → 6.1.0

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 (99) hide show
  1. package/README.md +27 -25
  2. package/bin/cucumber-tsflow +0 -0
  3. package/lib/behave.d.ts +1 -1
  4. package/lib/behave.js +27 -27
  5. package/lib/cli/argv-parser.d.ts +24 -24
  6. package/lib/cli/argv-parser.js +103 -103
  7. package/lib/cli/index.d.ts +22 -22
  8. package/lib/cli/index.js +100 -100
  9. package/lib/cli/load-configuration.d.ts +20 -20
  10. package/lib/cli/load-configuration.js +92 -92
  11. package/lib/cli/run.d.ts +1 -1
  12. package/lib/cli/run.js +47 -49
  13. package/lib/cucumber/binding-decorator.d.ts +10 -10
  14. package/lib/cucumber/binding-decorator.js +180 -180
  15. package/lib/cucumber/binding-registry.d.ts +82 -82
  16. package/lib/cucumber/binding-registry.js +215 -215
  17. package/lib/cucumber/hook-decorators.d.ts +46 -46
  18. package/lib/cucumber/hook-decorators.js +102 -102
  19. package/lib/cucumber/managed-scenario-context.d.ts +21 -21
  20. package/lib/cucumber/managed-scenario-context.js +95 -95
  21. package/lib/cucumber/message-collector.d.ts +81 -81
  22. package/lib/cucumber/message-collector.js +250 -250
  23. package/lib/cucumber/parallel/coordinator.d.ts +79 -79
  24. package/lib/cucumber/parallel/coordinator.js +246 -246
  25. package/lib/cucumber/parallel/run-worker.d.ts +1 -1
  26. package/lib/cucumber/parallel/run-worker.js +31 -31
  27. package/lib/cucumber/parallel/worker.d.ts +30 -30
  28. package/lib/cucumber/parallel/worker.js +103 -103
  29. package/lib/cucumber/run-cucumber.d.ts +14 -14
  30. package/lib/cucumber/run-cucumber.js +117 -117
  31. package/lib/cucumber/runtime.d.ts +25 -25
  32. package/lib/cucumber/runtime.js +39 -39
  33. package/lib/cucumber/step-definition-decorators.d.ts +24 -24
  34. package/lib/cucumber/step-definition-decorators.js +91 -91
  35. package/lib/cucumber/utils.d.ts +16 -16
  36. package/lib/cucumber/utils.js +77 -77
  37. package/lib/esnode.js +18 -18
  38. package/lib/esvue.d.ts +1 -1
  39. package/lib/esvue.js +40 -40
  40. package/lib/formatters/behave-json-formatter.d.ts +49 -49
  41. package/lib/formatters/behave-json-formatter.js +74 -74
  42. package/lib/formatters/tsflow-snippet-syntax.d.ts +9 -9
  43. package/lib/formatters/tsflow-snippet-syntax.js +89 -89
  44. package/lib/gherkin/configuration.d.ts +30 -30
  45. package/lib/gherkin/configuration.js +26 -26
  46. package/lib/gherkin/gherkin-feature.d.ts +28 -28
  47. package/lib/gherkin/gherkin-feature.js +333 -333
  48. package/lib/gherkin/gherkin-manager.d.ts +29 -29
  49. package/lib/gherkin/gherkin-manager.js +139 -114
  50. package/lib/gherkin/models.d.ts +45 -45
  51. package/lib/gherkin/models.js +2 -2
  52. package/lib/index.d.ts +4 -4
  53. package/lib/index.js +22 -22
  54. package/lib/snippet.d.ts +1 -1
  55. package/lib/snippet.js +27 -27
  56. package/lib/transpilers/esbuild-transpiler.d.ts +4 -4
  57. package/lib/transpilers/esbuild-transpiler.js +18 -18
  58. package/lib/transpilers/esbuild.d.ts +12 -12
  59. package/lib/transpilers/esbuild.js +54 -54
  60. package/lib/transpilers/vue-sfc/compiler.d.ts +7 -7
  61. package/lib/transpilers/vue-sfc/compiler.js +21 -21
  62. package/lib/transpilers/vue-sfc/index.d.ts +23 -23
  63. package/lib/transpilers/vue-sfc/index.js +46 -46
  64. package/lib/transpilers/vue-sfc/main.d.ts +8 -8
  65. package/lib/transpilers/vue-sfc/main.js +247 -247
  66. package/lib/transpilers/vue-sfc/script.d.ts +5 -5
  67. package/lib/transpilers/vue-sfc/script.js +41 -41
  68. package/lib/transpilers/vue-sfc/template.d.ts +8 -8
  69. package/lib/transpilers/vue-sfc/template.js +101 -101
  70. package/lib/transpilers/vue-sfc/types.d.ts +55 -55
  71. package/lib/transpilers/vue-sfc/types.js +2 -2
  72. package/lib/transpilers/vue-sfc/utils/descriptorCache.d.ts +13 -13
  73. package/lib/transpilers/vue-sfc/utils/descriptorCache.js +67 -67
  74. package/lib/transpilers/vue-sfc/utils/error.d.ts +3 -3
  75. package/lib/transpilers/vue-sfc/utils/error.js +22 -22
  76. package/lib/transpilers/vue-sfc/utils/query.d.ts +13 -13
  77. package/lib/transpilers/vue-sfc/utils/query.js +35 -35
  78. package/lib/tsnode.js +17 -17
  79. package/lib/tsvue.d.ts +1 -1
  80. package/lib/tsvue.js +39 -39
  81. package/lib/types/scenario-context.d.ts +16 -16
  82. package/lib/types/scenario-context.js +17 -17
  83. package/lib/types/scenario-info.d.ts +16 -16
  84. package/lib/types/scenario-info.js +22 -22
  85. package/lib/types/step-binding-flags.d.ts +53 -53
  86. package/lib/types/step-binding-flags.js +58 -58
  87. package/lib/types/step-binding.d.ts +50 -50
  88. package/lib/types/step-binding.js +17 -17
  89. package/lib/types/types.d.ts +21 -21
  90. package/lib/types/types.js +2 -2
  91. package/lib/utils/helpers.d.ts +6 -6
  92. package/lib/utils/helpers.js +17 -17
  93. package/lib/utils/logger.d.ts +3 -3
  94. package/lib/utils/logger.js +29 -29
  95. package/lib/utils/our-callsite.d.ts +27 -27
  96. package/lib/utils/our-callsite.js +72 -72
  97. package/lib/version.d.ts +1 -1
  98. package/lib/version.js +5 -5
  99. package/package.json +2 -1
@@ -1,29 +1,29 @@
1
- import { ParsedFeature } from './models';
2
- declare class StepInfo {
3
- constructor(name: string);
4
- name: string;
5
- text: string;
6
- tags: string;
7
- }
8
- export default class GherkinManager {
9
- private features;
10
- private gherkinFeature;
11
- constructor(paths: string[]);
12
- /**
13
- * Attempts to find a feature based on the steps found in
14
- * a steps test file
15
- * @param filePath
16
- * @returns
17
- */
18
- findFeatureByStepFile: (filePath: string) => ParsedFeature | undefined;
19
- generateKey: (name: string, tags: string[]) => string;
20
- /**
21
- * extracts 'given', 'when', 'then' step text and tags from
22
- * the file passed in.
23
- * @param filePath
24
- * @returns
25
- */
26
- parseSteps: (filePath: string) => StepInfo[];
27
- isHook: (stepName: string) => boolean;
28
- }
29
- export {};
1
+ import { ParsedFeature } from './models';
2
+ declare class StepInfo {
3
+ constructor(name: string);
4
+ name: string;
5
+ text: string;
6
+ tags: string;
7
+ }
8
+ export default class GherkinManager {
9
+ private features;
10
+ private gherkinFeature;
11
+ constructor(paths: string[]);
12
+ /**
13
+ * Attempts to find a feature based on the steps found in
14
+ * a steps test file
15
+ * @param filePath
16
+ * @returns
17
+ */
18
+ findFeatureByStepFile: (filePath: string) => ParsedFeature | undefined;
19
+ generateKey: (name: string, tags: string[]) => string;
20
+ /**
21
+ * extracts 'given', 'when', 'then' step text and tags from
22
+ * the file passed in.
23
+ * @param filePath
24
+ * @returns
25
+ */
26
+ parseSteps: (filePath: string) => StepInfo[];
27
+ isHook: (stepName: string) => boolean;
28
+ }
29
+ export {};
@@ -1,114 +1,139 @@
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
- const fs_1 = require("fs");
7
- const gherkin_feature_1 = __importDefault(require("./gherkin-feature"));
8
- const helpers_1 = require("../utils/helpers");
9
- const utils_1 = require("../cucumber/utils");
10
- class StepInfo {
11
- constructor(name) {
12
- this.name = name;
13
- }
14
- name;
15
- text = '';
16
- tags = '';
17
- }
18
- class GherkinManager {
19
- features = [];
20
- gherkinFeature = new gherkin_feature_1.default();
21
- constructor(paths) {
22
- for (const path of paths) {
23
- const features = this.gherkinFeature.loadFeatures(path);
24
- this.features = [...this.features, ...features];
25
- }
26
- }
27
- /**
28
- * Attempts to find a feature based on the steps found in
29
- * a steps test file
30
- * @param filePath
31
- * @returns
32
- */
33
- findFeatureByStepFile = (filePath) => {
34
- let featureResult = undefined;
35
- const fileSteps = this.parseSteps(filePath);
36
- for (const feature of this.features) {
37
- for (const scenario of feature.scenarios) {
38
- for (const step of scenario.steps) {
39
- if (['given', 'when', 'then'].find(x => x === step.keyword)) {
40
- const fileStep = fileSteps.find(s => (0, utils_1.hasMatchingStep)(s.text, step.stepText));
41
- if (fileStep) {
42
- // if we have tags on the step binding check to see if it matches one in the
43
- // current scenario, which also includes tags associated with the feature
44
- if ((0, helpers_1.hasStringValue)(fileStep.tags)) {
45
- if (scenario.tags.length > 0 && (0, utils_1.hasMatchingTags)(fileStep.tags, scenario.tags)) {
46
- featureResult = feature;
47
- }
48
- }
49
- else {
50
- featureResult = feature;
51
- }
52
- }
53
- }
54
- if (featureResult)
55
- break;
56
- }
57
- if (featureResult)
58
- break;
59
- }
60
- if (featureResult)
61
- break;
62
- }
63
- return featureResult;
64
- };
65
- generateKey = (name, tags) => {
66
- return `${name}:${tags.map(tag => tag.toLowerCase()).join(',')}`;
67
- };
68
- /**
69
- * extracts 'given', 'when', 'then' step text and tags from
70
- * the file passed in.
71
- * @param filePath
72
- * @returns
73
- */
74
- parseSteps = (filePath) => {
75
- const stepNames = ['before', 'beforestep', 'given', 'when', 'then', 'afterstep', 'after'];
76
- const steps = new Array();
77
- const stepText = (0, fs_1.readFileSync)(filePath, 'utf8');
78
- // get all of the decorator strings
79
- const stepDecorators = stepText.match(/@\w*\(([^()]+)\)/g);
80
- stepDecorators?.forEach(decorator => {
81
- const stepName = stepNames.find(x => decorator.toLowerCase().indexOf(x) >= 0);
82
- if (stepName) {
83
- const stepInfo = new StepInfo(stepName);
84
- // extract strings from inside decorator parens,
85
- // can be wrapped in single or double quotes
86
- const stepParams = decorator.match(/["']\s*([^"']+?)\s*["']/g);
87
- if (stepParams && stepParams.length > 0) {
88
- // first param in hooks is the tags parameter
89
- if (this.isHook(stepName)) {
90
- stepInfo.tags = stepParams[0].substring(1, stepParams[0].length - 1);
91
- }
92
- else {
93
- // steps support four parameters with last three optional
94
- // first is the pattern and second is a tag, which are the
95
- // two peices of information we need to make a match
96
- stepInfo.text = stepParams[0].substring(1, stepParams[0].length - 1);
97
- if (stepParams.length > 1 && (0, helpers_1.hasStringValue)(stepParams[1])) {
98
- stepInfo.tags = stepParams[1].substring(1, stepParams[1].length - 1);
99
- }
100
- }
101
- }
102
- steps.push(stepInfo);
103
- }
104
- });
105
- return steps;
106
- };
107
- isHook = (stepName) => {
108
- const hookNames = ['beforeall', 'before', 'beforestep', 'afterstep', 'after', 'afterall'];
109
- const match = hookNames.find(x => stepName.toLowerCase().indexOf(x) >= 0);
110
- return match != undefined;
111
- };
112
- }
113
- exports.default = GherkinManager;
114
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2hlcmtpbi1tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2doZXJraW4vZ2hlcmtpbi1tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsMkJBQWtDO0FBQ2xDLHdFQUErQztBQUUvQyw4Q0FBa0Q7QUFDbEQsNkNBQXFFO0FBRXJFLE1BQU0sUUFBUTtJQUNiLFlBQVksSUFBWTtRQUN2QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNsQixDQUFDO0lBQ0QsSUFBSSxDQUFTO0lBQ2IsSUFBSSxHQUFXLEVBQUUsQ0FBQztJQUNsQixJQUFJLEdBQVcsRUFBRSxDQUFDO0NBQ2xCO0FBRUQsTUFBcUIsY0FBYztJQUMxQixRQUFRLEdBQXlCLEVBQUUsQ0FBQztJQUNwQyxjQUFjLEdBQUcsSUFBSSx5QkFBYyxFQUFFLENBQUM7SUFFOUMsWUFBWSxLQUFlO1FBQzFCLEtBQUssTUFBTSxJQUFJLElBQUksS0FBSyxFQUFFO1lBQ3pCLE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxjQUFjLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ3hELElBQUksQ0FBQyxRQUFRLEdBQUcsQ0FBQyxHQUFHLElBQUksQ0FBQyxRQUFRLEVBQ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RUFBRTs0QkFDM0QsUUFBUSxDQUFDLElBQUksR0FBRyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO3lCQUNyRTtxQkFDRDtpQkFDRDtnQkFDRCxLQUFLLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO2FBQ3JCO1FBQ0YsQ0FBQyxDQUFDLENBQUM7UUFFSCxPQUFPLEtBQUssQ0FBQztJQUNkLENBQUMsQ0FBQztJQUVGLE1BQU0sR0FBRyxDQUFDLFFBQWdCLEVBQVcsRUFBRTtRQUN0QyxNQUFNLFNBQVMsR0FBRyxDQUFDLFdBQVcsRUFBRSxRQUFRLEVBQUUsWUFBWSxFQUFFLFdBQVcsRUFBRSxPQUFPLEVBQUUsVUFBVSxDQUFDLENBQUM7UUFDMUYsTUFBTSxLQUFLLEdBQUcsU0FBUyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLFFBQVEsQ0FBQyxXQUFXLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDMUUsT0FBTyxLQUFLLElBQUksU0FBUyxDQUFDO0lBQzNCLENBQUMsQ0FBQztDQUNGO0FBaEdELGlDQWdHQyJ9
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
+ const fs_1 = require("fs");
7
+ const gherkin_feature_1 = __importDefault(require("./gherkin-feature"));
8
+ const helpers_1 = require("../utils/helpers");
9
+ const utils_1 = require("../cucumber/utils");
10
+ class StepInfo {
11
+ constructor(name) {
12
+ this.name = name;
13
+ }
14
+ name;
15
+ text = '';
16
+ tags = '';
17
+ }
18
+ class GherkinManager {
19
+ features = [];
20
+ gherkinFeature = new gherkin_feature_1.default();
21
+ constructor(paths) {
22
+ for (const path of paths) {
23
+ const features = this.gherkinFeature.loadFeatures(path);
24
+ this.features = [...this.features, ...features];
25
+ }
26
+ }
27
+ /**
28
+ * Attempts to find a feature based on the steps found in
29
+ * a steps test file
30
+ * @param filePath
31
+ * @returns
32
+ */
33
+ findFeatureByStepFile = (filePath) => {
34
+ let featureResult = undefined;
35
+ const fileSteps = this.parseSteps(filePath);
36
+ for (const feature of this.features) {
37
+ for (const scenario of feature.scenarios) {
38
+ for (const step of scenario.steps) {
39
+ if (['given', 'when', 'then'].find(x => x === step.keyword)) {
40
+ const fileStep = fileSteps.find(s => (0, utils_1.hasMatchingStep)(s.text, step.stepText));
41
+ if (fileStep) {
42
+ // if we have tags on the step binding check to see if it matches one in the
43
+ // current scenario, which also includes tags associated with the feature
44
+ if ((0, helpers_1.hasStringValue)(fileStep.tags)) {
45
+ if (scenario.tags.length > 0 && (0, utils_1.hasMatchingTags)(fileStep.tags, scenario.tags)) {
46
+ featureResult = feature;
47
+ }
48
+ }
49
+ else {
50
+ featureResult = feature;
51
+ }
52
+ }
53
+ }
54
+ if (featureResult)
55
+ break;
56
+ }
57
+ if (featureResult)
58
+ break;
59
+ }
60
+ for (const scenarioOutline of feature.scenarioOutlines) {
61
+ if (scenarioOutline.exampleScenarios && (scenarioOutline.exampleScenarios?.length ?? 0 > 0)) {
62
+ for (const step of scenarioOutline.exampleScenarios[0].steps) {
63
+ if (['given', 'when', 'then'].find(x => x === step.keyword)) {
64
+ const fileStep = fileSteps.find(s => (0, utils_1.hasMatchingStep)(s.text, step.stepText));
65
+ if (fileStep) {
66
+ // if we have tags on the step binding check to see if it matches one in the
67
+ // current scenario, which also includes tags associated with the feature
68
+ if ((0, helpers_1.hasStringValue)(fileStep.tags)) {
69
+ if (scenarioOutline.tags.length > 0 && (0, utils_1.hasMatchingTags)(fileStep.tags, scenarioOutline.tags)) {
70
+ featureResult = feature;
71
+ }
72
+ }
73
+ else {
74
+ featureResult = feature;
75
+ }
76
+ }
77
+ }
78
+ if (featureResult)
79
+ break;
80
+ }
81
+ }
82
+ if (featureResult)
83
+ break;
84
+ }
85
+ if (featureResult)
86
+ break;
87
+ }
88
+ return featureResult;
89
+ };
90
+ generateKey = (name, tags) => {
91
+ return `${name}:${tags.map(tag => tag.toLowerCase()).join(',')}`;
92
+ };
93
+ /**
94
+ * extracts 'given', 'when', 'then' step text and tags from
95
+ * the file passed in.
96
+ * @param filePath
97
+ * @returns
98
+ */
99
+ parseSteps = (filePath) => {
100
+ const stepNames = ['before', 'beforestep', 'given', 'when', 'then', 'afterstep', 'after'];
101
+ const steps = new Array();
102
+ const stepText = (0, fs_1.readFileSync)(filePath, 'utf8');
103
+ // get all of the decorator strings
104
+ const stepDecorators = stepText.match(/@\w*\(([^()]+)\)/g);
105
+ stepDecorators?.forEach(decorator => {
106
+ const stepName = stepNames.find(x => decorator.toLowerCase().indexOf(x) >= 0);
107
+ if (stepName) {
108
+ const stepInfo = new StepInfo(stepName);
109
+ // extract strings from inside decorator parens,
110
+ // can be wrapped in single or double quotes
111
+ const stepParams = decorator.match(/["']\s*([^"']+?)\s*["']/g);
112
+ if (stepParams && stepParams.length > 0) {
113
+ // first param in hooks is the tags parameter
114
+ if (this.isHook(stepName)) {
115
+ stepInfo.tags = stepParams[0].substring(1, stepParams[0].length - 1);
116
+ }
117
+ else {
118
+ // steps support four parameters with last three optional
119
+ // first is the pattern and second is a tag, which are the
120
+ // two peices of information we need to make a match
121
+ stepInfo.text = stepParams[0].substring(1, stepParams[0].length - 1);
122
+ if (stepParams.length > 1 && (0, helpers_1.hasStringValue)(stepParams[1])) {
123
+ stepInfo.tags = stepParams[1].substring(1, stepParams[1].length - 1);
124
+ }
125
+ }
126
+ }
127
+ steps.push(stepInfo);
128
+ }
129
+ });
130
+ return steps;
131
+ };
132
+ isHook = (stepName) => {
133
+ const hookNames = ['beforeall', 'before', 'beforestep', 'afterstep', 'after', 'afterall'];
134
+ const match = hookNames.find(x => stepName.toLowerCase().indexOf(x) >= 0);
135
+ return match != undefined;
136
+ };
137
+ }
138
+ exports.default = GherkinManager;
139
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2hlcmtpbi1tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2doZXJraW4vZ2hlcmtpbi1tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsMkJBQWtDO0FBQ2xDLHdFQUErQztBQUUvQyw4Q0FBa0Q7QUFDbEQsNkNBQXFFO0FBRXJFLE1BQU0sUUFBUTtJQUNiLFlBQVksSUFBWTtRQUN2QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNsQixDQUFDO0lBQ0QsSUFBSSxDQUFTO0lBQ2IsSUFBSSxHQUFXLEVBQUUsQ0FBQztJQUNsQixJQUFJLEdBQVcsRUFBRSxDQUFDO0NBQ2xCO0FBRUQsTUFBcUIsY0FBYztJQUMxQixRQUFRLEdBQXlCLEVBQUUsQ0FBQztJQUNwQyxjQUFjLEdBQUcsSUFBSSx5QkFBYyxFQUFFLENBQUM7SUFFOUMsWUFBWSxLQUFlO1FBQzFCLEtBQUssTUFBTSxJQUFJLElBQUksS0FBSyxFQUFFO1lBQ3pCLE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxjQUFjLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ3hELElBQUksQ0FBQyxRQUFRLEdBQUcsQ0FBQyxHQUFHLElBQUksQ0FBQyxRQUFRLEVBQUUsR0FBRyxRQUFRLENBQUMsQ0FBQztTQUNoRDtJQUNGLENBQUM7SUFFRDs7Ozs7T0FLRztJQUNJLHFCQUFxQixHQUFHLENBQUMsUUFBZ0IsRUFBNkIsRUFBRTtRQUM5RSxJQUFJLG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QUFDLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQzt5QkFDckU7cUJBQ0Q7aUJBQ0Q7Z0JBQ0QsS0FBSyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQzthQUNyQjtRQUNGLENBQUMsQ0FBQyxDQUFDO1FBRUgsT0FBTyxLQUFLLENBQUM7SUFDZCxDQUFDLENBQUM7SUFFRixNQUFNLEdBQUcsQ0FBQyxRQUFnQixFQUFXLEVBQUU7UUFDdEMsTUFBTSxTQUFTLEdBQUcsQ0FBQyxXQUFXLEVBQUUsUUFBUSxFQUFFLFlBQVksRUFBRSxXQUFXLEVBQUUsT0FBTyxFQUFFLFVBQVUsQ0FBQyxDQUFDO1FBQzFGLE1BQU0sS0FBSyxHQUFHLFNBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxRQUFRLENBQUMsV0FBVyxFQUFFLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBQzFFLE9BQU8sS0FBSyxJQUFJLFNBQVMsQ0FBQztJQUMzQixDQUFDLENBQUM7Q0FDRjtBQXZIRCxpQ0F1SEMifQ==
@@ -1,45 +1,45 @@
1
- import { ManagedScenarioContext } from '../cucumber/managed-scenario-context';
2
- import { Options } from './configuration';
3
- export type StepFromStepDefinitions = {
4
- stepMatcher: string | RegExp;
5
- stepFunction(stepArguments?: any): void | PromiseLike<any>;
6
- };
7
- export type ScenarioFromStepDefinitions = {
8
- title: string;
9
- steps: StepFromStepDefinitions[];
10
- };
11
- export type FeatureFromStepDefinitions = {
12
- title: string;
13
- scenarios: ScenarioFromStepDefinitions[];
14
- };
15
- export type ParsedStep = {
16
- keyword: string;
17
- stepText: string;
18
- stepArgument: string | {};
19
- lineNumber: number;
20
- };
21
- export type ParsedScenario = {
22
- title: string;
23
- steps: ParsedStep[];
24
- tags: string[];
25
- lineNumber: number;
26
- skippedViaTagFilter: boolean;
27
- scenarioContext: ManagedScenarioContext | undefined;
28
- };
29
- export type ParsedScenarioOutline = {
30
- title: string;
31
- tags: string[];
32
- scenarios: ParsedScenario[];
33
- steps: ParsedStep[];
34
- lineNumber: number;
35
- skippedViaTagFilter: boolean;
36
- scenarioContext: ManagedScenarioContext | undefined;
37
- };
38
- export type ParsedFeature = {
39
- title: string;
40
- featureFile: string;
41
- scenarios: ParsedScenario[];
42
- scenarioOutlines: ParsedScenarioOutline[];
43
- options: Options;
44
- tags: string[];
45
- };
1
+ import { ManagedScenarioContext } from '../cucumber/managed-scenario-context';
2
+ import { Options } from './configuration';
3
+ export type StepFromStepDefinitions = {
4
+ stepMatcher: string | RegExp;
5
+ stepFunction(stepArguments?: any): void | PromiseLike<any>;
6
+ };
7
+ export type ScenarioFromStepDefinitions = {
8
+ title: string;
9
+ steps: StepFromStepDefinitions[];
10
+ };
11
+ export type FeatureFromStepDefinitions = {
12
+ title: string;
13
+ scenarios: ScenarioFromStepDefinitions[];
14
+ };
15
+ export type ParsedStep = {
16
+ keyword: string;
17
+ stepText: string;
18
+ stepArgument: string | {};
19
+ lineNumber: number;
20
+ };
21
+ export type ParsedScenario = {
22
+ title: string;
23
+ steps: ParsedStep[];
24
+ tags: string[];
25
+ lineNumber: number;
26
+ skippedViaTagFilter: boolean;
27
+ scenarioContext: ManagedScenarioContext | undefined;
28
+ };
29
+ export type ParsedScenarioOutline = {
30
+ title: string;
31
+ tags: string[];
32
+ exampleScenarios: ParsedScenario[];
33
+ steps: ParsedStep[];
34
+ lineNumber: number;
35
+ skippedViaTagFilter: boolean;
36
+ scenarioContext: ManagedScenarioContext | undefined;
37
+ };
38
+ export type ParsedFeature = {
39
+ title: string;
40
+ featureFile: string;
41
+ scenarios: ParsedScenario[];
42
+ scenarioOutlines: ParsedScenarioOutline[];
43
+ options: Options;
44
+ tags: string[];
45
+ };
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2doZXJraW4vbW9kZWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './cucumber/binding-decorator';
2
- export * from './cucumber/hook-decorators';
3
- export * from './cucumber/step-definition-decorators';
4
- export { ScenarioContext, ScenarioInfo } from './types/scenario-context';
1
+ export * from './cucumber/binding-decorator';
2
+ export * from './cucumber/hook-decorators';
3
+ export * from './cucumber/step-definition-decorators';
4
+ export { ScenarioContext, ScenarioInfo } from './types/scenario-context';
package/lib/index.js CHANGED
@@ -1,23 +1,23 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ScenarioInfo = void 0;
18
- __exportStar(require("./cucumber/binding-decorator"), exports);
19
- __exportStar(require("./cucumber/hook-decorators"), exports);
20
- __exportStar(require("./cucumber/step-definition-decorators"), exports);
21
- var scenario_context_1 = require("./types/scenario-context");
22
- Object.defineProperty(exports, "ScenarioInfo", { enumerable: true, get: function () { return scenario_context_1.ScenarioInfo; } });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ScenarioInfo = void 0;
18
+ __exportStar(require("./cucumber/binding-decorator"), exports);
19
+ __exportStar(require("./cucumber/hook-decorators"), exports);
20
+ __exportStar(require("./cucumber/step-definition-decorators"), exports);
21
+ var scenario_context_1 = require("./types/scenario-context");
22
+ Object.defineProperty(exports, "ScenarioInfo", { enumerable: true, get: function () { return scenario_context_1.ScenarioInfo; } });
23
23
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwrREFBNkM7QUFDN0MsNkRBQTJDO0FBQzNDLHdFQUFzRDtBQUN0RCw2REFBeUU7QUFBL0MsZ0hBQUEsWUFBWSxPQUFBIn0=
package/lib/snippet.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/lib/snippet.js CHANGED
@@ -1,28 +1,28 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const tsflow = __importStar(require("./formatters/tsflow-snippet-syntax"));
27
- module.exports = tsflow;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const tsflow = __importStar(require("./formatters/tsflow-snippet-syntax"));
27
+ module.exports = tsflow;
28
28
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25pcHBldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9zbmlwcGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyRUFBNkQ7QUFFN0QsTUFBTSxDQUFDLE9BQU8sR0FBRyxNQUFNLENBQUMifQ==
@@ -1,4 +1,4 @@
1
- import { TranspileOptions, Transpiler, TranspileOutput } from 'ts-node/dist/transpilers/types';
2
- export declare class EsbuildTranspiler implements Transpiler {
3
- transpile: (input: string, options: TranspileOptions) => TranspileOutput;
4
- }
1
+ import { TranspileOptions, Transpiler, TranspileOutput } from 'ts-node/dist/transpilers/types';
2
+ export declare class EsbuildTranspiler implements Transpiler {
3
+ transpile: (input: string, options: TranspileOptions) => TranspileOutput;
4
+ }
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EsbuildTranspiler = void 0;
4
- const esbuild_1 = require("./esbuild");
5
- const create = (_createOptions) => {
6
- return new EsbuildTranspiler();
7
- };
8
- class EsbuildTranspiler {
9
- transpile = (input, options) => {
10
- const result = (0, esbuild_1.transpileCode)(input, options.fileName);
11
- return {
12
- outputText: result.output,
13
- sourceMapText: result.sourceMap
14
- };
15
- };
16
- }
17
- exports.EsbuildTranspiler = EsbuildTranspiler;
18
- exports.create = create;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EsbuildTranspiler = void 0;
4
+ const esbuild_1 = require("./esbuild");
5
+ const create = (_createOptions) => {
6
+ return new EsbuildTranspiler();
7
+ };
8
+ class EsbuildTranspiler {
9
+ transpile = (input, options) => {
10
+ const result = (0, esbuild_1.transpileCode)(input, options.fileName);
11
+ return {
12
+ outputText: result.output,
13
+ sourceMapText: result.sourceMap
14
+ };
15
+ };
16
+ }
17
+ exports.EsbuildTranspiler = EsbuildTranspiler;
18
+ exports.create = create;
19
19
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNidWlsZC10cmFuc3BpbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3RyYW5zcGlsZXJzL2VzYnVpbGQtdHJhbnNwaWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSx1Q0FBMEM7QUFFMUMsTUFBTSxNQUFNLEdBQUcsQ0FBQyxjQUF1QyxFQUFjLEVBQUU7SUFDdEUsT0FBTyxJQUFJLGlCQUFpQixFQUFFLENBQUM7QUFDaEMsQ0FBQyxDQUFDO0FBRUYsTUFBYSxpQkFBaUI7SUFDN0IsU0FBUyxHQUFHLENBQUMsS0FBYSxFQUFFLE9BQXlCLEVBQW1CLEVBQUU7UUFDekUsTUFBTSxNQUFNLEdBQUcsSUFBQSx1QkFBYSxFQUFDLEtBQUssRUFBRSxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7UUFFdEQsT0FBTztZQUNOLFVBQVUsRUFBRSxNQUFNLENBQUMsTUFBTTtZQUN6QixhQUFhLEVBQUUsTUFBTSxDQUFDLFNBQVM7U0FDWixDQUFDO0lBQ3RCLENBQUMsQ0FBQztDQUNGO0FBVEQsOENBU0M7QUFFRCxPQUFPLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQyJ9
@@ -1,12 +1,12 @@
1
- import { Loader, CommonOptions, TransformOptions, BuildOptions } from 'esbuild';
2
- export type TranspileOptions = {
3
- debug: boolean;
4
- esbuild?: CommonOptions & TransformOptions & BuildOptions;
5
- };
6
- export type TranspileResults = {
7
- output: string;
8
- sourceMap?: string;
9
- };
10
- export declare const loaders: Record<string, Loader>;
11
- export declare const supports: (filename: string) => boolean;
12
- export declare const transpileCode: (code: string, filename: string, ext?: string, _options?: Partial<TranspileOptions>) => TranspileResults;
1
+ import { Loader, CommonOptions, TransformOptions, BuildOptions } from 'esbuild';
2
+ export type TranspileOptions = {
3
+ debug: boolean;
4
+ esbuild?: CommonOptions & TransformOptions & BuildOptions;
5
+ };
6
+ export type TranspileResults = {
7
+ output: string;
8
+ sourceMap?: string;
9
+ };
10
+ export declare const loaders: Record<string, Loader>;
11
+ export declare const supports: (filename: string) => boolean;
12
+ export declare const transpileCode: (code: string, filename: string, ext?: string, _options?: Partial<TranspileOptions>) => TranspileResults;