pickle-jar 1.0.2 → 1.0.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 (36) hide show
  1. package/dist/src/feature-file-visitor.js +129 -0
  2. package/dist/src/feature-file-visitor.js.map +1 -0
  3. package/dist/src/get-call-sites.js +12 -0
  4. package/dist/src/get-call-sites.js.map +1 -0
  5. package/dist/src/grammar/GherkinLexer.js +222 -0
  6. package/dist/src/grammar/GherkinLexer.js.map +1 -0
  7. package/dist/src/grammar/GherkinParser.js +1696 -0
  8. package/dist/src/grammar/GherkinParser.js.map +1 -0
  9. package/dist/src/grammar/GherkinParserVisitor.js +4 -0
  10. package/dist/src/grammar/GherkinParserVisitor.js.map +1 -0
  11. package/dist/src/index.js.map +1 -0
  12. package/dist/src/step-definition.js +3 -0
  13. package/dist/src/step-definition.js.map +1 -0
  14. package/dist/src/step.js +3 -0
  15. package/dist/src/step.js.map +1 -0
  16. package/dist/src/test-runner.js +32 -0
  17. package/dist/src/test-runner.js.map +1 -0
  18. package/dist/test/runner.js +87 -0
  19. package/dist/test/runner.js.map +1 -0
  20. package/dist/types/src/feature-file-visitor.d.ts +19 -0
  21. package/dist/types/src/get-call-sites.d.ts +2 -0
  22. package/dist/types/src/grammar/GherkinLexer.d.ts +44 -0
  23. package/dist/types/src/grammar/GherkinParser.d.ts +261 -0
  24. package/dist/types/src/grammar/GherkinParserVisitor.d.ts +150 -0
  25. package/dist/types/src/index.d.ts +3 -0
  26. package/dist/types/src/step-definition.d.ts +5 -0
  27. package/dist/types/src/step.d.ts +1 -0
  28. package/dist/types/src/test-runner.d.ts +2 -0
  29. package/dist/types/test/runner.d.ts +1 -0
  30. package/package.json +4 -1
  31. package/.eslintignore +0 -4
  32. package/.eslintrc +0 -12
  33. package/.idea/modules.xml +0 -8
  34. package/.idea/pickle-jar.iml +0 -12
  35. package/.idea/vcs.xml +0 -6
  36. package/Makefile +0 -43
@@ -0,0 +1,150 @@
1
+ import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";
2
+ import { FeatureFileContext } from "./GherkinParser";
3
+ import { FeatureContext } from "./GherkinParser";
4
+ import { BackgroundContext } from "./GherkinParser";
5
+ import { ScenarioContext } from "./GherkinParser";
6
+ import { ScenarioOutlineContext } from "./GherkinParser";
7
+ import { ExamplesBlockContext } from "./GherkinParser";
8
+ import { TableHeaderContext } from "./GherkinParser";
9
+ import { TableRowContext } from "./GherkinParser";
10
+ import { CellContext } from "./GherkinParser";
11
+ import { StepContext } from "./GherkinParser";
12
+ import { GivenStepContext } from "./GherkinParser";
13
+ import { AndGivenStepContext } from "./GherkinParser";
14
+ import { WhenStepContext } from "./GherkinParser";
15
+ import { AndWhenStepContext } from "./GherkinParser";
16
+ import { ThenStepContext } from "./GherkinParser";
17
+ import { AndStepContext } from "./GherkinParser";
18
+ import { ButStepContext } from "./GherkinParser";
19
+ import { DocStringContext } from "./GherkinParser";
20
+ import { TagsContext } from "./GherkinParser";
21
+ import { ContentTextContext } from "./GherkinParser";
22
+ /**
23
+ * This interface defines a complete generic visitor for a parse tree produced
24
+ * by `GherkinParser`.
25
+ *
26
+ * @param <Result> The return type of the visit operation. Use `void` for
27
+ * operations with no return type.
28
+ */
29
+ export interface GherkinParserVisitor<Result> extends ParseTreeVisitor<Result> {
30
+ /**
31
+ * Visit a parse tree produced by `GherkinParser.featureFile`.
32
+ * @param ctx the parse tree
33
+ * @return the visitor result
34
+ */
35
+ visitFeatureFile?: (ctx: FeatureFileContext) => Result;
36
+ /**
37
+ * Visit a parse tree produced by `GherkinParser.feature`.
38
+ * @param ctx the parse tree
39
+ * @return the visitor result
40
+ */
41
+ visitFeature?: (ctx: FeatureContext) => Result;
42
+ /**
43
+ * Visit a parse tree produced by `GherkinParser.background`.
44
+ * @param ctx the parse tree
45
+ * @return the visitor result
46
+ */
47
+ visitBackground?: (ctx: BackgroundContext) => Result;
48
+ /**
49
+ * Visit a parse tree produced by `GherkinParser.scenario`.
50
+ * @param ctx the parse tree
51
+ * @return the visitor result
52
+ */
53
+ visitScenario?: (ctx: ScenarioContext) => Result;
54
+ /**
55
+ * Visit a parse tree produced by `GherkinParser.scenarioOutline`.
56
+ * @param ctx the parse tree
57
+ * @return the visitor result
58
+ */
59
+ visitScenarioOutline?: (ctx: ScenarioOutlineContext) => Result;
60
+ /**
61
+ * Visit a parse tree produced by `GherkinParser.examplesBlock`.
62
+ * @param ctx the parse tree
63
+ * @return the visitor result
64
+ */
65
+ visitExamplesBlock?: (ctx: ExamplesBlockContext) => Result;
66
+ /**
67
+ * Visit a parse tree produced by `GherkinParser.tableHeader`.
68
+ * @param ctx the parse tree
69
+ * @return the visitor result
70
+ */
71
+ visitTableHeader?: (ctx: TableHeaderContext) => Result;
72
+ /**
73
+ * Visit a parse tree produced by `GherkinParser.tableRow`.
74
+ * @param ctx the parse tree
75
+ * @return the visitor result
76
+ */
77
+ visitTableRow?: (ctx: TableRowContext) => Result;
78
+ /**
79
+ * Visit a parse tree produced by `GherkinParser.cell`.
80
+ * @param ctx the parse tree
81
+ * @return the visitor result
82
+ */
83
+ visitCell?: (ctx: CellContext) => Result;
84
+ /**
85
+ * Visit a parse tree produced by `GherkinParser.step`.
86
+ * @param ctx the parse tree
87
+ * @return the visitor result
88
+ */
89
+ visitStep?: (ctx: StepContext) => Result;
90
+ /**
91
+ * Visit a parse tree produced by `GherkinParser.givenStep`.
92
+ * @param ctx the parse tree
93
+ * @return the visitor result
94
+ */
95
+ visitGivenStep?: (ctx: GivenStepContext) => Result;
96
+ /**
97
+ * Visit a parse tree produced by `GherkinParser.andGivenStep`.
98
+ * @param ctx the parse tree
99
+ * @return the visitor result
100
+ */
101
+ visitAndGivenStep?: (ctx: AndGivenStepContext) => Result;
102
+ /**
103
+ * Visit a parse tree produced by `GherkinParser.whenStep`.
104
+ * @param ctx the parse tree
105
+ * @return the visitor result
106
+ */
107
+ visitWhenStep?: (ctx: WhenStepContext) => Result;
108
+ /**
109
+ * Visit a parse tree produced by `GherkinParser.andWhenStep`.
110
+ * @param ctx the parse tree
111
+ * @return the visitor result
112
+ */
113
+ visitAndWhenStep?: (ctx: AndWhenStepContext) => Result;
114
+ /**
115
+ * Visit a parse tree produced by `GherkinParser.thenStep`.
116
+ * @param ctx the parse tree
117
+ * @return the visitor result
118
+ */
119
+ visitThenStep?: (ctx: ThenStepContext) => Result;
120
+ /**
121
+ * Visit a parse tree produced by `GherkinParser.andStep`.
122
+ * @param ctx the parse tree
123
+ * @return the visitor result
124
+ */
125
+ visitAndStep?: (ctx: AndStepContext) => Result;
126
+ /**
127
+ * Visit a parse tree produced by `GherkinParser.butStep`.
128
+ * @param ctx the parse tree
129
+ * @return the visitor result
130
+ */
131
+ visitButStep?: (ctx: ButStepContext) => Result;
132
+ /**
133
+ * Visit a parse tree produced by `GherkinParser.docString`.
134
+ * @param ctx the parse tree
135
+ * @return the visitor result
136
+ */
137
+ visitDocString?: (ctx: DocStringContext) => Result;
138
+ /**
139
+ * Visit a parse tree produced by `GherkinParser.tags`.
140
+ * @param ctx the parse tree
141
+ * @return the visitor result
142
+ */
143
+ visitTags?: (ctx: TagsContext) => Result;
144
+ /**
145
+ * Visit a parse tree produced by `GherkinParser.contentText`.
146
+ * @param ctx the parse tree
147
+ * @return the visitor result
148
+ */
149
+ visitContentText?: (ctx: ContentTextContext) => Result;
150
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./test-runner";
2
+ export * from "./step-definition";
3
+ export * from "./step";
@@ -0,0 +1,5 @@
1
+ import { Step } from "./step";
2
+ export interface StepDefinition<TWorld> {
3
+ match: RegExp;
4
+ step: Step<TWorld>;
5
+ }
@@ -0,0 +1 @@
1
+ export type Step<TWorld> = (world: TWorld, ...params: string[]) => void;
@@ -0,0 +1,2 @@
1
+ import { StepDefinition } from "./step-definition";
2
+ export declare function testRunner<TWorld>(globPattern: string, stepDefinitions: StepDefinition<TWorld>[], world: TWorld): void;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "pickle-jar",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/types/src/index.d.ts",
6
6
  "repository": "git@github0.com:nseba/pickle-jar.git",
7
7
  "author": "Sebastian Negomireanu",
8
8
  "license": "MIT",
9
+ "files": [
10
+ "dist/"
11
+ ],
9
12
  "devDependencies": {
10
13
  "@types/glob": "^8.1.0",
11
14
  "@types/jest": "^29.5.1",
package/.eslintignore DELETED
@@ -1,4 +0,0 @@
1
- node_modules
2
- dist
3
- coverage
4
- src/grammar
package/.eslintrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "plugins": [
5
- "@typescript-eslint"
6
- ],
7
- "extends": [
8
- "eslint:recommended",
9
- "plugin:@typescript-eslint/eslint-recommended",
10
- "plugin:@typescript-eslint/recommended"
11
- ]
12
- }
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/pickle-jar.iml" filepath="$PROJECT_DIR$/.idea/pickle-jar.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
package/Makefile DELETED
@@ -1,43 +0,0 @@
1
- .DEFAULT_GOAL := rebuild
2
- .PHONY: all build rebuild watch clean test test-prod test-watch lint start doc
3
-
4
- build:
5
- npx tsc
6
- npx cpx "src/**/*{.jsx?, .css}" "dist/"
7
-
8
- rebuild:
9
- $(MAKE) clean
10
- $(MAKE) build
11
-
12
- watch:
13
- $(MAKE) build
14
- (trap 'kill 0' SIGINT; npx tsc-watch & npx cpx "src/**/*{.jsx?, .css}" "dist/" --watch)
15
-
16
- start:
17
- $(MAKE) build
18
- (trap 'kill 0' SIGINT; npx tsc-watch & npx cpx "src/**/*{.jsx?,.css}" "dist/" --watch & nodemon -r dotenv/config dist/bin/index.js)
19
-
20
- clean:
21
- rm -rfv ./dist
22
- rm -vf *.tsbuildinfo
23
-
24
- test:
25
- npx jest
26
-
27
- test-prod:
28
- npx jest --coverage --no-cache
29
-
30
- test-watch:
31
- npx jest --watch
32
-
33
- lint:
34
- npx eslint '*/**/*.{js,ts,tsx}' --fix
35
-
36
- grammar:
37
- . ./grammar.sh
38
-
39
- all:
40
- $(MAKE) clean
41
- $(MAKE) build
42
- $(MAKE) lint
43
- $(MAKE) test