quickpickle 1.6.1 → 1.7.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.
@@ -0,0 +1,138 @@
1
+ export declare class PickleTable {
2
+ rows: readonly PickleTableRow[];
3
+ }
4
+ export declare class PickleTableCell {
5
+ value: string;
6
+ }
7
+ export declare class PickleTableRow {
8
+ cells: readonly PickleTableCell[];
9
+ }
10
+ export declare class DataTable {
11
+ private readonly rawTable;
12
+ constructor(sourceTable: PickleTable | string[][]);
13
+ /**
14
+ * This method returns an array of objects of the shape { [key: string]: string }.
15
+ * It is intended for tables with a header row, as follows:
16
+ *
17
+ * ```
18
+ * | id | name | color | taste |
19
+ * | 1 | apple | red | sweet |
20
+ * | 2 | banana | yellow | sweet |
21
+ * | 3 | orange | orange | sour |
22
+ * ```
23
+ *
24
+ * This would return the following array of objects:
25
+ *
26
+ * ```
27
+ * [
28
+ * { id: '1', name: 'apple', color: 'red', taste: 'sweet' },
29
+ * { id: '2', name: 'banana', color: 'yellow', taste: 'sweet' },
30
+ * { id: '3', name: 'orange', color: 'orange', taste: 'sour' },
31
+ * ]
32
+ * ```
33
+ *
34
+ * @returns Record<string, string>[]
35
+ */
36
+ hashes(): Record<string, string>[];
37
+ /**
38
+ * This method returns the raw table as a two-dimensional array.
39
+ * It can be used for tables with or without a header row, for example:
40
+ *
41
+ * ```
42
+ * | id | name | color | taste |
43
+ * | 1 | apple | red | sweet |
44
+ * | 2 | banana | yellow | sweet |
45
+ * | 3 | orange | orange | sour |
46
+ * ```
47
+ *
48
+ * would return the following array of objects:
49
+ *
50
+ * ```
51
+ * [
52
+ * ['id', 'name', 'color', 'taste'],
53
+ * ['1', 'apple', 'red', 'sweet'],
54
+ * ['2', 'banana', 'yellow', 'sweet'],
55
+ * ['3', 'orange', 'orange', 'sour'],
56
+ * ]
57
+ * ```
58
+ *
59
+ * @returns string[][]
60
+ */
61
+ raw(): string[][];
62
+ /**
63
+ * This method is intended for tables with a header row, and returns
64
+ * the value rows as a two-dimensional array, without the header row:
65
+ *
66
+ * ```
67
+ * | id | name | color | taste |
68
+ * | 1 | apple | red | sweet |
69
+ * | 2 | banana | yellow | sweet |
70
+ * | 3 | orange | orange | sour |
71
+ * ```
72
+ *
73
+ * would return the following array of objects:
74
+ *
75
+ * ```
76
+ * [
77
+ * ['1', 'apple', 'red', 'sweet'],
78
+ * ['2', 'banana', 'yellow', 'sweet'],
79
+ * ['3', 'orange', 'orange', 'sour'],
80
+ * ]
81
+ * ```
82
+ *
83
+ * @returns string[][]
84
+ */
85
+ rows(): string[][];
86
+ /**
87
+ * This method is intended for tables with exactly two columns.
88
+ * It returns a single object with the first column as keys and
89
+ * the second column as values.
90
+ *
91
+ * ```
92
+ * | id | 1 |
93
+ * | name | apple |
94
+ * | color | red |
95
+ * | taste | sweet |
96
+ * ```
97
+ *
98
+ * would return the following object:
99
+ *
100
+ * ```
101
+ * {
102
+ * id: '1',
103
+ * name: 'apple',
104
+ * color: 'red',
105
+ * taste: 'sweet',
106
+ * }
107
+ * ```
108
+ *
109
+ * @returns Record<string, string>
110
+ */
111
+ rowsHash(): Record<string, string>;
112
+ /**
113
+ * This method transposes the DataTable, making the columns into rows
114
+ * and vice versa. For example the following raw table:
115
+ *
116
+ * ```
117
+ * [
118
+ * ['1', 'apple', 'red', 'sweet'],
119
+ * ['2', 'banana', 'yellow', 'sweet'],
120
+ * ['3', 'orange', 'orange', 'sour'],
121
+ * ]
122
+ * ```
123
+ *
124
+ * would be transposed to:
125
+ *
126
+ * ```
127
+ * [
128
+ * ['1', '2', '3'],
129
+ * ['apple', 'banana', 'orange'],
130
+ * ['red', 'yellow', 'orange'],
131
+ * ['sweet', 'sweet', 'sour'],
132
+ * ]
133
+ * ```
134
+ *
135
+ * @returns DataTable
136
+ */
137
+ transpose(): DataTable;
138
+ }
package/dist/steps.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Expression } from '@cucumber/cucumber-expressions';
2
- import { IParameterTypeDefinition } from '@cucumber/cucumber/lib/support_code_library_builder/types';
2
+ import { type IParameterTypeDefinition } from '@cucumber/cucumber/lib/support_code_library_builder/types';
3
3
  interface StepDefinition {
4
4
  expression: string | RegExp;
5
5
  f: (state: any, ...args: any[]) => any;
package/dist/world.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { TestContext } from 'vitest';
2
- import { QuickPickleConfig } from '.';
2
+ import type { QuickPickleConfig } from '.';
3
3
  interface Common {
4
4
  info: {
5
5
  feature: string;
@@ -29,6 +29,7 @@ export interface QuickPickleWorldInterface {
29
29
  [key: string]: any;
30
30
  };
31
31
  common: Common;
32
+ projectRoot: string;
32
33
  init: () => Promise<void>;
33
34
  tagsMatch(tags: string[]): string[] | null;
34
35
  }
@@ -36,6 +37,7 @@ export type InfoConstructor = Omit<QuickPickleWorldInterface['info'], 'errors'>
36
37
  common: Common;
37
38
  };
38
39
  export declare class QuickPickleWorld implements QuickPickleWorldInterface {
40
+ private _projectRoot;
39
41
  info: QuickPickleWorldInterface['info'];
40
42
  common: QuickPickleWorldInterface['common'];
41
43
  context: TestContext;
@@ -47,6 +49,7 @@ export declare class QuickPickleWorld implements QuickPickleWorldInterface {
47
49
  [key: string]: any;
48
50
  }>;
49
51
  get isComplete(): boolean;
52
+ get projectRoot(): string;
50
53
  tagsMatch(tags: string[]): string[] | null;
51
54
  toString(): string;
52
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickpickle",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Plugin for Vitest to run tests written in Gherkin Syntax.",
5
5
  "keywords": [
6
6
  "BDD",
@@ -27,39 +27,42 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "require": "./dist/index.cjs",
30
- "import": "./dist/index.esm.js",
31
- "types": "./dist/index.d.ts"
30
+ "import": "./dist/index.esm.js"
32
31
  }
33
32
  },
34
33
  "files": [
35
34
  "dist"
36
35
  ],
37
36
  "scripts": {
38
- "build": "rollup -c",
37
+ "build": "rollup -c && FORMAT=cjs rollup -c",
39
38
  "type-check": "tsc --noEmit",
40
39
  "test:watch": "vitest",
41
40
  "test": "vitest --run"
42
41
  },
43
42
  "dependencies": {
44
- "@cucumber/cucumber": "^11.1.0",
45
- "@cucumber/cucumber-expressions": "^17.1.0",
46
- "@cucumber/gherkin": "^29.0.0",
47
- "@cucumber/messages": "^22.0.0",
48
- "@cucumber/tag-expressions": "^6.1.1",
43
+ "@cucumber/cucumber": "^11.2.0",
44
+ "@cucumber/cucumber-expressions": "^18.0.1",
45
+ "@cucumber/gherkin": "^32.1.0",
46
+ "@cucumber/messages": "^27.2.0",
47
+ "@cucumber/tag-expressions": "^6.1.2",
48
+ "lodash": "^4.17.21",
49
49
  "lodash-es": "^4.17.21"
50
50
  },
51
51
  "devDependencies": {
52
- "@rollup/plugin-replace": "^6.0.1",
52
+ "@optimize-lodash/esbuild-plugin": "^3.2.0",
53
+ "@optimize-lodash/rollup-plugin": "^5.0.2",
54
+ "@rollup/plugin-replace": "^6.0.2",
53
55
  "@rollup/plugin-terser": "^0.4.4",
54
- "@rollup/plugin-typescript": "^12.1.1",
55
- "@types/lodash": "^4.17.13",
56
+ "@rollup/plugin-typescript": "^12.1.2",
57
+ "@types/lodash": "^4.17.16",
56
58
  "@types/lodash-es": "^4.17.12",
57
- "@types/node": "^18.19.66",
58
- "@vitest/browser": "^2.1.6",
59
- "playwright": "^1.49.0",
60
- "rollup": "^3.29.5",
61
- "typescript": "^5.7.2",
62
- "vitest": "^2.1.6"
59
+ "@types/node": "^22.15.17",
60
+ "@vitest/browser": "^3.1.3",
61
+ "playwright": "^1.52.0",
62
+ "rollup": "^4.40.2",
63
+ "typescript": "^5.8.3",
64
+ "vite": "^6.3.5",
65
+ "vitest": "^3.1.3"
63
66
  },
64
67
  "peerDependencies": {
65
68
  "vitest": "^1.0.0 || >=2.0.0"