testeranto 0.235.0 → 0.235.2
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/dist/stakeholder/index.tsx +1 -1
- package/package.json +2 -2
- package/src/lib/tiposkripto/dist/module/Node.js +1393 -826
- package/src/lib/tiposkripto/dist/module/Web.js +1403 -826
- package/src/lib/tiposkripto/dist/module/index.js +243 -841
- package/src/lib/tiposkripto/dist/types/Types.d.ts +55 -10
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/Adapters.d.ts +3 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/BaseTiposkripto.d.ts +21 -18
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/CoreTypes.d.ts +25 -30
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/Node.d.ts +4 -4
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/Web.d.ts +9 -3
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/index.d.ts +21 -29
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/interop/index.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/interop/jest.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/interop/mocha.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/interop/nodeNative.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/interop/vite.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/types.d.ts +18 -26
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/BaseSuite.d.ts +0 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/aaa/BaseDescribe.d.ts +39 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/aaa/BaseIt.d.ts +22 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/bdd/BaseGiven.d.ts +48 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/bdd/BaseThen.d.ts +38 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/bdd/BaseWhen.d.ts +37 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/internal/CommonUtils.d.ts +45 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/tdt/BaseConfirm.d.ts +26 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/tdt/BaseExpected.d.ts +27 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/tdt/BaseShould.d.ts +24 -0
- package/src/lib/tiposkripto/dist/types/lib/tiposkripto/src/verbs/tdt/BaseValue.d.ts +38 -0
- package/src/lib/tiposkripto/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/src/lib/tiposkripto/package.json +1 -1
- package/src/stakeholderApp/index.tsx +1 -1
|
@@ -2,25 +2,49 @@
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
5
|
-
// src/
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
// src/Adapters.ts
|
|
6
|
+
var BaseAdapter = () => ({
|
|
7
|
+
prepareAll: async (input, testResource, artifactory) => {
|
|
8
|
+
return input;
|
|
9
|
+
},
|
|
10
|
+
prepareEach: async function(subject, initializer, testResource, initialValues, artifactory) {
|
|
11
|
+
return subject;
|
|
12
|
+
},
|
|
13
|
+
cleanupEach: async (store, key, artifactory) => Promise.resolve(store),
|
|
14
|
+
cleanupAll: (store, artifactory) => void 0,
|
|
15
|
+
verify: async (store, checkCb, testResource, artifactory) => {
|
|
16
|
+
return checkCb(store);
|
|
17
|
+
},
|
|
18
|
+
execute: async (store, actionCB, testResource, artifactory) => {
|
|
19
|
+
return actionCB(store);
|
|
20
|
+
},
|
|
21
|
+
assert: (x) => x
|
|
22
|
+
});
|
|
23
|
+
var DefaultAdapter = (p) => {
|
|
24
|
+
const base = BaseAdapter();
|
|
25
|
+
const adapter = {
|
|
26
|
+
prepareAll: p.prepareAll || base.prepareAll,
|
|
27
|
+
prepareEach: p.prepareEach || base.prepareEach,
|
|
28
|
+
execute: p.execute || base.execute,
|
|
29
|
+
verify: p.verify || base.verify,
|
|
30
|
+
cleanupEach: p.cleanupEach || base.cleanupEach,
|
|
31
|
+
cleanupAll: p.cleanupAll || base.cleanupAll,
|
|
32
|
+
assert: p.assert || base.assert
|
|
33
|
+
};
|
|
34
|
+
return adapter;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/types.ts
|
|
38
|
+
var defaultTestResourceRequirement = {
|
|
39
|
+
ports: 0
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// src/verbs/internal/CommonUtils.ts
|
|
43
|
+
var CommonUtils = class {
|
|
44
|
+
/**
|
|
45
|
+
* Normalize a path string for consistent artifact storage
|
|
46
|
+
*/
|
|
47
|
+
static normalizePath(path2) {
|
|
24
48
|
if (typeof path2 !== "string") {
|
|
25
49
|
throw new Error(
|
|
26
50
|
`[ARTIFACT ERROR] Expected string, got ${typeof path2}: ${JSON.stringify(
|
|
@@ -28,42 +52,100 @@ var BaseSetup = class {
|
|
|
28
52
|
)}`
|
|
29
53
|
);
|
|
30
54
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
return path2.replace(/\\/g, "/");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Add an artifact with path normalization
|
|
59
|
+
*/
|
|
60
|
+
static addArtifact(artifacts, path2) {
|
|
61
|
+
artifacts.push(this.normalizePath(path2));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create a fallback artifactory for logging
|
|
65
|
+
*/
|
|
66
|
+
static createFallbackArtifactory(context, basePath) {
|
|
67
|
+
const { suiteIndex, givenKey, whenIndex, thenIndex, valueKey, rowIndex } = context;
|
|
68
|
+
const actualBasePath = basePath || "testeranto";
|
|
35
69
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
writeFileSync: (filename, payload) => {
|
|
71
|
+
let path2 = "";
|
|
72
|
+
if (suiteIndex !== void 0) {
|
|
73
|
+
path2 += `suite-${suiteIndex}/`;
|
|
74
|
+
}
|
|
75
|
+
if (givenKey !== void 0) {
|
|
76
|
+
path2 += `given-${givenKey}/`;
|
|
77
|
+
}
|
|
78
|
+
if (whenIndex !== void 0) {
|
|
79
|
+
path2 += `when-${whenIndex}/`;
|
|
80
|
+
}
|
|
81
|
+
if (thenIndex !== void 0) {
|
|
82
|
+
path2 += `then-${thenIndex}/`;
|
|
83
|
+
}
|
|
84
|
+
if (valueKey !== void 0) {
|
|
85
|
+
path2 += `value-${valueKey}/`;
|
|
86
|
+
}
|
|
87
|
+
if (rowIndex !== void 0) {
|
|
88
|
+
path2 += `row-${rowIndex}/`;
|
|
89
|
+
}
|
|
90
|
+
path2 += filename;
|
|
91
|
+
const fullPath = `${actualBasePath}/${path2}`;
|
|
92
|
+
console.log(`[Artifactory] Would write to ${fullPath}: ${payload.substring(0, 100)}...`);
|
|
93
|
+
},
|
|
94
|
+
screenshot: (filename, payload) => {
|
|
95
|
+
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
96
|
+
}
|
|
48
97
|
};
|
|
49
98
|
}
|
|
50
|
-
|
|
51
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Standard error handling for test operations
|
|
101
|
+
*/
|
|
102
|
+
static handleTestError(error, target) {
|
|
103
|
+
target.failed = true;
|
|
104
|
+
target.fails++;
|
|
105
|
+
target.error = error;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Standard method to create an object representation
|
|
109
|
+
*/
|
|
110
|
+
static toObj(target, additionalProps = {}) {
|
|
111
|
+
const baseObj = {
|
|
112
|
+
key: target.key,
|
|
113
|
+
name: target.name,
|
|
114
|
+
error: target.error ? [target.error, target.error.stack] : null,
|
|
115
|
+
failed: target.failed,
|
|
116
|
+
features: target.features || [],
|
|
117
|
+
artifacts: target.artifacts,
|
|
118
|
+
status: target.status
|
|
119
|
+
};
|
|
120
|
+
if (target.fails !== void 0) {
|
|
121
|
+
baseObj.fails = target.fails;
|
|
122
|
+
}
|
|
123
|
+
return { ...baseObj, ...additionalProps };
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// src/verbs/aaa/BaseDescribe.ts
|
|
128
|
+
var BaseDescribe = class {
|
|
129
|
+
constructor(features, its, describeCB, initialValues) {
|
|
130
|
+
this.error = null;
|
|
131
|
+
this.store = null;
|
|
132
|
+
this.key = "";
|
|
133
|
+
this.failed = false;
|
|
134
|
+
this.artifacts = [];
|
|
135
|
+
this.fails = 0;
|
|
136
|
+
this.features = features;
|
|
137
|
+
this.its = its;
|
|
138
|
+
this.describeCB = describeCB;
|
|
139
|
+
this.initialValues = initialValues;
|
|
52
140
|
}
|
|
53
|
-
|
|
141
|
+
addArtifact(path2) {
|
|
142
|
+
CommonUtils.addArtifact(this.artifacts, path2);
|
|
143
|
+
}
|
|
144
|
+
async describe(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
54
145
|
this.key = key;
|
|
55
146
|
this.fails = 0;
|
|
56
|
-
const actualArtifactory = artifactory || ((fPath, value) => {
|
|
57
|
-
});
|
|
58
|
-
const setupArtifactory = (fPath, value) => actualArtifactory(`setup-${key}/${fPath}`, value);
|
|
59
147
|
try {
|
|
60
|
-
this.store = await this.
|
|
61
|
-
subject,
|
|
62
|
-
testResourceConfiguration,
|
|
63
|
-
setupArtifactory,
|
|
64
|
-
this.setupCB,
|
|
65
|
-
this.initialValues
|
|
66
|
-
);
|
|
148
|
+
this.store = await this.describeCB("x");
|
|
67
149
|
this.status = true;
|
|
68
150
|
} catch (e) {
|
|
69
151
|
this.status = false;
|
|
@@ -73,39 +155,16 @@ var BaseSetup = class {
|
|
|
73
155
|
return this.store;
|
|
74
156
|
}
|
|
75
157
|
try {
|
|
76
|
-
for (const [
|
|
77
|
-
try {
|
|
78
|
-
const actionArtifactory = this.createArtifactoryForAction(
|
|
79
|
-
key,
|
|
80
|
-
actionNdx,
|
|
81
|
-
suiteNdx
|
|
82
|
-
);
|
|
83
|
-
this.store = await actionStep.test(
|
|
84
|
-
this.store,
|
|
85
|
-
testResourceConfiguration,
|
|
86
|
-
actionArtifactory
|
|
87
|
-
);
|
|
88
|
-
} catch (e) {
|
|
89
|
-
this.failed = true;
|
|
90
|
-
this.fails++;
|
|
91
|
-
this.error = e;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
for (const [checkNdx, checkStep] of this.checks.entries()) {
|
|
158
|
+
for (const [itNdx, it] of this.its.entries()) {
|
|
95
159
|
try {
|
|
96
|
-
const
|
|
97
|
-
const checkArtifactory = this.createArtifactoryForCheck(
|
|
98
|
-
key,
|
|
99
|
-
checkNdx,
|
|
100
|
-
suiteNdx
|
|
101
|
-
);
|
|
102
|
-
const t = await checkStep.test(
|
|
160
|
+
const result = await it.test(
|
|
103
161
|
this.store,
|
|
104
162
|
testResourceConfiguration,
|
|
105
|
-
|
|
106
|
-
checkArtifactory
|
|
163
|
+
artifactory
|
|
107
164
|
);
|
|
108
|
-
|
|
165
|
+
if (result !== void 0) {
|
|
166
|
+
tester(result);
|
|
167
|
+
}
|
|
109
168
|
} catch (e) {
|
|
110
169
|
this.failed = true;
|
|
111
170
|
this.fails++;
|
|
@@ -116,128 +175,89 @@ var BaseSetup = class {
|
|
|
116
175
|
this.error = e;
|
|
117
176
|
this.failed = true;
|
|
118
177
|
this.fails++;
|
|
119
|
-
} finally {
|
|
120
|
-
try {
|
|
121
|
-
await this.afterEach(this.store, this.key, setupArtifactory);
|
|
122
|
-
} catch (e) {
|
|
123
|
-
this.failed = true;
|
|
124
|
-
this.fails++;
|
|
125
|
-
this.error = e;
|
|
126
|
-
}
|
|
127
178
|
}
|
|
128
179
|
return this.store;
|
|
129
180
|
}
|
|
130
|
-
|
|
131
|
-
const self = this;
|
|
132
|
-
if (self._parent && self._parent.createArtifactory) {
|
|
133
|
-
return self._parent.createArtifactory({
|
|
134
|
-
givenKey: key,
|
|
135
|
-
whenIndex: actionIndex,
|
|
136
|
-
suiteIndex: suiteNdx
|
|
137
|
-
});
|
|
138
|
-
}
|
|
181
|
+
toObj() {
|
|
139
182
|
return {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
149
|
-
},
|
|
150
|
-
screenshot: (filename, payload) => {
|
|
151
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
152
|
-
}
|
|
183
|
+
key: this.key,
|
|
184
|
+
its: this.its.map((it) => it.toObj()),
|
|
185
|
+
error: this.error ? [this.error.message, this.error.stack] : null,
|
|
186
|
+
failed: this.failed,
|
|
187
|
+
features: this.features || [],
|
|
188
|
+
artifacts: this.artifacts,
|
|
189
|
+
status: this.status,
|
|
190
|
+
fails: this.fails
|
|
153
191
|
};
|
|
154
192
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// src/verbs/aaa/BaseIt.ts
|
|
196
|
+
var BaseIt = class {
|
|
197
|
+
constructor(name, itCB) {
|
|
198
|
+
this.error = null;
|
|
199
|
+
this.artifacts = [];
|
|
200
|
+
this.name = name;
|
|
201
|
+
this.itCB = itCB;
|
|
202
|
+
}
|
|
203
|
+
addArtifact(path2) {
|
|
204
|
+
CommonUtils.addArtifact(this.artifacts, path2);
|
|
205
|
+
}
|
|
206
|
+
async test(store, testResourceConfiguration, artifactory) {
|
|
207
|
+
try {
|
|
208
|
+
const result = await this.itCB(store);
|
|
209
|
+
this.status = true;
|
|
210
|
+
return result;
|
|
211
|
+
} catch (e) {
|
|
212
|
+
this.status = false;
|
|
213
|
+
this.error = e;
|
|
214
|
+
throw e;
|
|
163
215
|
}
|
|
216
|
+
}
|
|
217
|
+
toObj() {
|
|
164
218
|
return {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
path2 += `setup-${key}/`;
|
|
171
|
-
path2 += `check-${checkIndex} ${filename}`;
|
|
172
|
-
console.log(`[Artifactory] Would write to: ${path2}`);
|
|
173
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
174
|
-
},
|
|
175
|
-
screenshot: (filename, payload) => {
|
|
176
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
177
|
-
}
|
|
219
|
+
name: this.name,
|
|
220
|
+
status: this.status,
|
|
221
|
+
error: this.error ? `${this.error.name}: ${this.error.message}
|
|
222
|
+
${this.error.stack}` : null,
|
|
223
|
+
artifacts: this.artifacts
|
|
178
224
|
};
|
|
179
225
|
}
|
|
180
226
|
};
|
|
181
227
|
|
|
182
|
-
// src/BaseGiven.ts
|
|
183
|
-
var BaseGiven = class
|
|
228
|
+
// src/verbs/bdd/BaseGiven.ts
|
|
229
|
+
var BaseGiven = class {
|
|
184
230
|
constructor(features, whens, thens, givenCB, initialValues) {
|
|
185
|
-
|
|
231
|
+
this.error = null;
|
|
232
|
+
this.store = null;
|
|
233
|
+
this.key = "";
|
|
234
|
+
this.failed = false;
|
|
186
235
|
this.artifacts = [];
|
|
187
236
|
this.fails = 0;
|
|
188
|
-
this.
|
|
237
|
+
this.testResourceConfiguration = null;
|
|
238
|
+
this.features = features;
|
|
189
239
|
this.whens = whens || [];
|
|
190
240
|
this.thens = thens || [];
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
console.log(`[BaseGiven.constructor] thens:`, this.thens.length);
|
|
241
|
+
this.givenCB = givenCB;
|
|
242
|
+
this.initialValues = initialValues;
|
|
194
243
|
}
|
|
195
244
|
addArtifact(path2) {
|
|
196
|
-
|
|
197
|
-
throw new Error(
|
|
198
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path2}: ${JSON.stringify(
|
|
199
|
-
path2
|
|
200
|
-
)}`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
const normalizedPath = path2.replace(/\\/g, "/");
|
|
204
|
-
this.artifacts.push(normalizedPath);
|
|
245
|
+
CommonUtils.addArtifact(this.artifacts, path2);
|
|
205
246
|
}
|
|
206
|
-
// Set the parent explicitly
|
|
207
247
|
setParent(parent) {
|
|
208
248
|
this._parent = parent;
|
|
209
|
-
console.log(`[BaseGiven.setParent] _parent set to:`, parent);
|
|
210
|
-
}
|
|
211
|
-
beforeAll(store) {
|
|
212
|
-
return store;
|
|
213
249
|
}
|
|
214
250
|
toObj() {
|
|
215
251
|
const whens = this.whens || [];
|
|
216
252
|
const thens = this.thens || [];
|
|
217
|
-
return {
|
|
218
|
-
|
|
219
|
-
actions: whens.map((w) => {
|
|
253
|
+
return CommonUtils.toObj(this, {
|
|
254
|
+
whens: whens.map((w) => {
|
|
220
255
|
if (w && w.toObj) return w.toObj();
|
|
221
256
|
console.error("When step is not as expected!", JSON.stringify(w));
|
|
222
257
|
return {};
|
|
223
258
|
}),
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
failed: this.failed,
|
|
227
|
-
features: this.features || [],
|
|
228
|
-
artifacts: this.artifacts,
|
|
229
|
-
status: this.status
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
// Implement BaseSetup's abstract method
|
|
233
|
-
async setupThat(subject, testResourceConfiguration, artifactory, setupCB, initialValues) {
|
|
234
|
-
return this.givenThat(
|
|
235
|
-
subject,
|
|
236
|
-
testResourceConfiguration,
|
|
237
|
-
artifactory,
|
|
238
|
-
setupCB,
|
|
239
|
-
initialValues
|
|
240
|
-
);
|
|
259
|
+
thens: thens.map((t) => t && t.toObj ? t.toObj() : {})
|
|
260
|
+
});
|
|
241
261
|
}
|
|
242
262
|
async afterEach(store, key, artifactory) {
|
|
243
263
|
return store;
|
|
@@ -245,8 +265,9 @@ var BaseGiven = class extends BaseSetup {
|
|
|
245
265
|
async give(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
246
266
|
this.key = key;
|
|
247
267
|
this.fails = 0;
|
|
268
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
248
269
|
this._suiteIndex = suiteNdx;
|
|
249
|
-
const actualArtifactory = artifactory
|
|
270
|
+
const actualArtifactory = artifactory;
|
|
250
271
|
try {
|
|
251
272
|
this.store = await this.givenThat(
|
|
252
273
|
subject,
|
|
@@ -258,9 +279,7 @@ var BaseGiven = class extends BaseSetup {
|
|
|
258
279
|
this.status = true;
|
|
259
280
|
} catch (e) {
|
|
260
281
|
this.status = false;
|
|
261
|
-
|
|
262
|
-
this.fails++;
|
|
263
|
-
this.error = e;
|
|
282
|
+
CommonUtils.handleTestError(e, this);
|
|
264
283
|
return this.store;
|
|
265
284
|
}
|
|
266
285
|
try {
|
|
@@ -279,9 +298,7 @@ var BaseGiven = class extends BaseSetup {
|
|
|
279
298
|
whenArtifactory
|
|
280
299
|
);
|
|
281
300
|
} catch (e) {
|
|
282
|
-
|
|
283
|
-
this.fails++;
|
|
284
|
-
this.error = e;
|
|
301
|
+
CommonUtils.handleTestError(e, this);
|
|
285
302
|
}
|
|
286
303
|
}
|
|
287
304
|
} else {
|
|
@@ -305,205 +322,104 @@ var BaseGiven = class extends BaseSetup {
|
|
|
305
322
|
);
|
|
306
323
|
tester(t);
|
|
307
324
|
} catch (e) {
|
|
308
|
-
|
|
309
|
-
this.fails++;
|
|
310
|
-
this.error = e;
|
|
325
|
+
CommonUtils.handleTestError(e, this);
|
|
311
326
|
}
|
|
312
327
|
}
|
|
313
328
|
} else {
|
|
314
329
|
console.warn(`[BaseGiven.give] thens is not an array:`, thens);
|
|
315
330
|
}
|
|
316
331
|
} catch (e) {
|
|
317
|
-
|
|
318
|
-
this.failed = true;
|
|
319
|
-
this.fails++;
|
|
332
|
+
CommonUtils.handleTestError(e, this);
|
|
320
333
|
} finally {
|
|
321
334
|
try {
|
|
322
335
|
await this.afterEach(this.store, this.key, actualArtifactory);
|
|
323
336
|
} catch (e) {
|
|
324
|
-
|
|
325
|
-
this.fails++;
|
|
326
|
-
this.error = e;
|
|
337
|
+
CommonUtils.handleTestError(e, this);
|
|
327
338
|
}
|
|
328
339
|
}
|
|
329
340
|
return this.store;
|
|
330
341
|
}
|
|
331
|
-
|
|
342
|
+
createArtifactoryForWhen(givenKey, whenIndex, suiteNdx) {
|
|
332
343
|
const self = this;
|
|
333
|
-
console.log(`[BaseGiven.createDefaultArtifactory] self._parent:`, self._parent);
|
|
334
|
-
console.log(`[BaseGiven.createDefaultArtifactory] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
335
344
|
if (self._parent && self._parent.createArtifactory) {
|
|
336
|
-
|
|
345
|
+
return self._parent.createArtifactory({
|
|
337
346
|
givenKey,
|
|
347
|
+
whenIndex,
|
|
338
348
|
suiteIndex: suiteNdx
|
|
339
349
|
});
|
|
340
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Created artifactory from parent:`, artifactory);
|
|
341
|
-
return artifactory;
|
|
342
|
-
}
|
|
343
|
-
let basePath = "testeranto";
|
|
344
|
-
if (self._parent && self._parent.testResourceConfiguration?.fs) {
|
|
345
|
-
basePath = self._parent.testResourceConfiguration.fs;
|
|
346
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Using base path from parent: ${basePath}`);
|
|
347
|
-
} else {
|
|
348
|
-
console.log(`[BaseGiven.createDefaultArtifactory] Using default base path: ${basePath}`);
|
|
349
350
|
}
|
|
350
|
-
return
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
path2 += `suite-${suiteNdx}/`;
|
|
355
|
-
}
|
|
356
|
-
path2 += `given-${givenKey}/`;
|
|
357
|
-
path2 += filename;
|
|
358
|
-
if (!path2.match(/\.[a-zA-Z0-9]+$/)) {
|
|
359
|
-
path2 += ".txt";
|
|
360
|
-
}
|
|
361
|
-
const fullPath = `${basePath}/${path2}`;
|
|
362
|
-
console.log(`[Artifactory] Writing to: ${fullPath}`);
|
|
363
|
-
if (self._parent && typeof self._parent.writeFileSync === "function") {
|
|
364
|
-
self._parent.writeFileSync(fullPath, payload);
|
|
365
|
-
} else {
|
|
366
|
-
console.log(`[Artifactory] Would write to: ${fullPath}`);
|
|
367
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
screenshot: (filename, payload) => {
|
|
371
|
-
let path2 = "";
|
|
372
|
-
if (suiteNdx !== void 0) {
|
|
373
|
-
path2 += `suite-${suiteNdx}/`;
|
|
374
|
-
}
|
|
375
|
-
path2 += `given-${givenKey}/`;
|
|
376
|
-
path2 += filename;
|
|
377
|
-
if (!path2.match(/\.[a-zA-Z0-9]+$/)) {
|
|
378
|
-
path2 += ".png";
|
|
379
|
-
}
|
|
380
|
-
const fullPath = `${basePath}/${path2}`;
|
|
381
|
-
console.log(`[Artifactory] Would take screenshot: ${fullPath}`);
|
|
382
|
-
if (self._parent && typeof self._parent.screenshot === "function") {
|
|
383
|
-
self._parent.screenshot(fullPath, payload || "");
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
};
|
|
351
|
+
return CommonUtils.createFallbackArtifactory(
|
|
352
|
+
{ givenKey, whenIndex, suiteIndex: suiteNdx },
|
|
353
|
+
this.testResourceConfiguration?.fs
|
|
354
|
+
);
|
|
387
355
|
}
|
|
388
|
-
|
|
356
|
+
createArtifactoryForThen(givenKey, thenIndex, suiteNdx) {
|
|
389
357
|
const self = this;
|
|
390
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] self._parent:`, self._parent);
|
|
391
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
392
358
|
if (self._parent && self._parent.createArtifactory) {
|
|
393
|
-
|
|
359
|
+
return self._parent.createArtifactory({
|
|
394
360
|
givenKey,
|
|
395
|
-
|
|
361
|
+
thenIndex,
|
|
396
362
|
suiteIndex: suiteNdx
|
|
397
363
|
});
|
|
398
|
-
console.log(`[BaseGiven.createArtifactoryForWhen] Created artifactory:`, artifactory);
|
|
399
|
-
return artifactory;
|
|
400
364
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
if (suiteNdx !== void 0) {
|
|
406
|
-
path2 += `suite-${suiteNdx}/`;
|
|
407
|
-
}
|
|
408
|
-
path2 += `given-${givenKey}/`;
|
|
409
|
-
path2 += `when-${whenIndex} ${filename}`;
|
|
410
|
-
console.log(`[Artifactory] Would write to: ${path2}`);
|
|
411
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
412
|
-
},
|
|
413
|
-
screenshot: (filename, payload) => {
|
|
414
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
createArtifactoryForThen(givenKey, thenIndex, suiteNdx) {
|
|
419
|
-
const self = this;
|
|
420
|
-
console.log(`[BaseGiven.createArtifactoryForThen] self._parent:`, self._parent);
|
|
421
|
-
console.log(`[BaseGiven.createArtifactoryForThen] self._parent.createArtifactory:`, self._parent?.createArtifactory);
|
|
422
|
-
if (self._parent && self._parent.createArtifactory) {
|
|
423
|
-
const artifactory = self._parent.createArtifactory({
|
|
424
|
-
givenKey,
|
|
425
|
-
thenIndex,
|
|
426
|
-
suiteIndex: suiteNdx
|
|
427
|
-
});
|
|
428
|
-
console.log(`[BaseGiven.createArtifactoryForThen] Created artifactory:`, artifactory);
|
|
429
|
-
return artifactory;
|
|
430
|
-
}
|
|
431
|
-
console.log(`[BaseGiven.createArtifactoryForThen] Using fallback artifactory`);
|
|
432
|
-
return {
|
|
433
|
-
writeFileSync: (filename, payload) => {
|
|
434
|
-
let path2 = "";
|
|
435
|
-
if (suiteNdx !== void 0) {
|
|
436
|
-
path2 += `suite-${suiteNdx}/`;
|
|
437
|
-
}
|
|
438
|
-
path2 += `given-${givenKey}/`;
|
|
439
|
-
path2 += `then-${thenIndex} ${filename}`;
|
|
440
|
-
console.log(`[Artifactory] Would write to: ${path2}`);
|
|
441
|
-
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
442
|
-
},
|
|
443
|
-
screenshot: (filename, payload) => {
|
|
444
|
-
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
445
|
-
}
|
|
446
|
-
};
|
|
365
|
+
return CommonUtils.createFallbackArtifactory(
|
|
366
|
+
{ givenKey, thenIndex, suiteIndex: suiteNdx },
|
|
367
|
+
this.testResourceConfiguration?.fs
|
|
368
|
+
);
|
|
447
369
|
}
|
|
448
370
|
};
|
|
449
371
|
|
|
450
|
-
// src/
|
|
451
|
-
var
|
|
452
|
-
constructor(name,
|
|
372
|
+
// src/verbs/bdd/BaseThen.ts
|
|
373
|
+
var BaseThen = class {
|
|
374
|
+
constructor(name, thenCB) {
|
|
453
375
|
this.error = null;
|
|
454
|
-
this.artifacts = [];
|
|
455
376
|
this.name = name;
|
|
456
|
-
this.
|
|
457
|
-
}
|
|
458
|
-
addArtifact(path2) {
|
|
459
|
-
if (typeof path2 !== "string") {
|
|
460
|
-
throw new Error(
|
|
461
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path2}: ${JSON.stringify(
|
|
462
|
-
path2
|
|
463
|
-
)}`
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
const normalizedPath = path2.replace(/\\/g, "/");
|
|
467
|
-
this.artifacts.push(normalizedPath);
|
|
468
|
-
}
|
|
469
|
-
toObj() {
|
|
470
|
-
const obj = {
|
|
471
|
-
name: this.name,
|
|
472
|
-
status: this.status,
|
|
473
|
-
error: this.error ? `${this.error.name}: ${this.error.message}
|
|
474
|
-
${this.error.stack}` : null,
|
|
475
|
-
artifacts: this.artifacts
|
|
476
|
-
};
|
|
477
|
-
return obj;
|
|
377
|
+
this.thenCB = thenCB;
|
|
478
378
|
}
|
|
479
|
-
async test(store, testResourceConfiguration, artifactory) {
|
|
379
|
+
async test(store, testResourceConfiguration, filepath, artifactory) {
|
|
480
380
|
try {
|
|
481
|
-
const
|
|
381
|
+
const x = await this.butThen(
|
|
482
382
|
store,
|
|
483
|
-
|
|
383
|
+
async (s) => {
|
|
384
|
+
try {
|
|
385
|
+
if (typeof this.thenCB === "function") {
|
|
386
|
+
const result = await this.thenCB(s);
|
|
387
|
+
return result;
|
|
388
|
+
} else {
|
|
389
|
+
return this.thenCB;
|
|
390
|
+
}
|
|
391
|
+
} catch (e) {
|
|
392
|
+
this.error = e;
|
|
393
|
+
throw e;
|
|
394
|
+
}
|
|
395
|
+
},
|
|
484
396
|
testResourceConfiguration,
|
|
485
397
|
artifactory
|
|
486
398
|
);
|
|
487
399
|
this.status = true;
|
|
488
|
-
return
|
|
400
|
+
return x;
|
|
489
401
|
} catch (e) {
|
|
490
402
|
this.status = false;
|
|
491
403
|
this.error = e;
|
|
492
404
|
throw e;
|
|
493
405
|
}
|
|
494
406
|
}
|
|
407
|
+
toObj() {
|
|
408
|
+
return {
|
|
409
|
+
name: this.name,
|
|
410
|
+
status: this.status,
|
|
411
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null
|
|
412
|
+
};
|
|
413
|
+
}
|
|
495
414
|
};
|
|
496
415
|
|
|
497
|
-
// src/BaseWhen.ts
|
|
498
|
-
var BaseWhen = class
|
|
416
|
+
// src/verbs/bdd/BaseWhen.ts
|
|
417
|
+
var BaseWhen = class {
|
|
499
418
|
constructor(name, whenCB) {
|
|
500
|
-
|
|
419
|
+
this.error = null;
|
|
420
|
+
this.name = name;
|
|
501
421
|
this.whenCB = whenCB;
|
|
502
422
|
}
|
|
503
|
-
// Implement BaseAction's abstract method
|
|
504
|
-
async performAction(store, actionCB, testResource) {
|
|
505
|
-
return this.andWhen(store, actionCB, testResource);
|
|
506
|
-
}
|
|
507
423
|
async test(store, testResourceConfiguration, artifactory) {
|
|
508
424
|
try {
|
|
509
425
|
const result = await this.andWhen(
|
|
@@ -520,416 +436,402 @@ var BaseWhen = class extends BaseAction {
|
|
|
520
436
|
throw e;
|
|
521
437
|
}
|
|
522
438
|
}
|
|
439
|
+
toObj() {
|
|
440
|
+
return {
|
|
441
|
+
name: this.name,
|
|
442
|
+
status: this.status,
|
|
443
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null
|
|
444
|
+
};
|
|
445
|
+
}
|
|
523
446
|
};
|
|
524
447
|
|
|
525
|
-
// src/
|
|
526
|
-
var
|
|
527
|
-
constructor(
|
|
528
|
-
this.
|
|
529
|
-
this.
|
|
530
|
-
this.checkCB = checkCB;
|
|
531
|
-
this.error = false;
|
|
448
|
+
// src/verbs/tdt/BaseConfirm.ts
|
|
449
|
+
var BaseConfirm = class {
|
|
450
|
+
constructor(features, testCases, confirmCB, initialValues) {
|
|
451
|
+
this.key = "";
|
|
452
|
+
this.failed = false;
|
|
532
453
|
this.artifacts = [];
|
|
454
|
+
this.fails = 0;
|
|
455
|
+
this.error = null;
|
|
456
|
+
this.store = null;
|
|
457
|
+
this.features = features;
|
|
458
|
+
this.testCases = testCases || [];
|
|
459
|
+
this.confirmCB = confirmCB;
|
|
460
|
+
this.initialValues = initialValues;
|
|
533
461
|
}
|
|
534
462
|
addArtifact(path2) {
|
|
535
|
-
|
|
536
|
-
throw new Error(
|
|
537
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path2}: ${JSON.stringify(
|
|
538
|
-
path2
|
|
539
|
-
)}`
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
const normalizedPath = path2.replace(/\\/g, "/");
|
|
543
|
-
this.artifacts.push(normalizedPath);
|
|
463
|
+
CommonUtils.addArtifact(this.artifacts, path2);
|
|
544
464
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
name: this.name,
|
|
548
|
-
error: this.error,
|
|
549
|
-
artifacts: this.artifacts,
|
|
550
|
-
status: this.status
|
|
551
|
-
};
|
|
552
|
-
return obj;
|
|
465
|
+
setParent(parent) {
|
|
466
|
+
this._parent = parent;
|
|
553
467
|
}
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
468
|
+
toObj() {
|
|
469
|
+
const testCases = this.testCases || [];
|
|
470
|
+
return CommonUtils.toObj(this, {
|
|
471
|
+
testCases: testCases.map((testCase) => {
|
|
472
|
+
if (Array.isArray(testCase) && testCase.length >= 2) {
|
|
473
|
+
const [value, should] = testCase;
|
|
474
|
+
let inputData = null;
|
|
560
475
|
try {
|
|
561
|
-
if (typeof
|
|
562
|
-
|
|
563
|
-
|
|
476
|
+
if (typeof value === "function") {
|
|
477
|
+
inputData = value();
|
|
478
|
+
} else if (value && typeof value.toObj === "function") {
|
|
479
|
+
const obj = value.toObj();
|
|
480
|
+
inputData = obj.features || obj;
|
|
564
481
|
} else {
|
|
565
|
-
|
|
482
|
+
inputData = value;
|
|
566
483
|
}
|
|
567
484
|
} catch (e) {
|
|
568
|
-
|
|
569
|
-
throw e;
|
|
485
|
+
inputData = `Error: ${e.message}`;
|
|
570
486
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
487
|
+
let testDescription = null;
|
|
488
|
+
try {
|
|
489
|
+
if (should) {
|
|
490
|
+
if (typeof should === "function") {
|
|
491
|
+
if (should.name && should.name !== "") {
|
|
492
|
+
testDescription = should.name;
|
|
493
|
+
} else {
|
|
494
|
+
const funcStr = should.toString();
|
|
495
|
+
if (funcStr.includes("beEqualTo")) {
|
|
496
|
+
testDescription = "beEqualTo";
|
|
497
|
+
} else if (funcStr.includes("beGreaterThan")) {
|
|
498
|
+
testDescription = "beGreaterThan";
|
|
499
|
+
} else if (funcStr.includes("whenMultipliedAreAtLeast")) {
|
|
500
|
+
testDescription = "whenMultipliedAreAtLeast";
|
|
501
|
+
} else if (funcStr.includes("equal")) {
|
|
502
|
+
testDescription = "equal";
|
|
503
|
+
} else {
|
|
504
|
+
testDescription = "Test function";
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
} else if (should && typeof should.toObj === "function") {
|
|
508
|
+
const obj = should.toObj();
|
|
509
|
+
testDescription = obj.name || "Should";
|
|
510
|
+
} else {
|
|
511
|
+
testDescription = String(should);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
} catch (e) {
|
|
515
|
+
testDescription = `Error: ${e.message}`;
|
|
516
|
+
}
|
|
517
|
+
return {
|
|
518
|
+
input: inputData,
|
|
519
|
+
test: testDescription
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
return testCase;
|
|
523
|
+
})
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
async confirm(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
527
|
+
this.key = key;
|
|
528
|
+
this.fails = 0;
|
|
529
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
530
|
+
this._suiteIndex = suiteNdx;
|
|
531
|
+
const actualArtifactory = artifactory;
|
|
532
|
+
this.store = null;
|
|
533
|
+
this.status = true;
|
|
534
|
+
try {
|
|
535
|
+
for (const [caseIndex, testCase] of this.testCases.entries()) {
|
|
536
|
+
try {
|
|
537
|
+
if (Array.isArray(testCase) && testCase.length >= 2) {
|
|
538
|
+
const [value, should] = testCase;
|
|
539
|
+
console.log("[BaseConfirm] value:", value);
|
|
540
|
+
console.log("[BaseConfirm] should:", should);
|
|
541
|
+
console.log("[BaseConfirm] value type:", typeof value);
|
|
542
|
+
console.log("[BaseConfirm] should type:", typeof should);
|
|
543
|
+
let input;
|
|
544
|
+
if (typeof value === "function") {
|
|
545
|
+
input = value();
|
|
546
|
+
console.log("[BaseConfirm] input from function:", input);
|
|
547
|
+
} else {
|
|
548
|
+
input = value;
|
|
549
|
+
console.log("[BaseConfirm] input direct:", input);
|
|
550
|
+
}
|
|
551
|
+
if (typeof should === "function") {
|
|
552
|
+
console.log("[BaseConfirm] input:", input);
|
|
553
|
+
console.log("[BaseConfirm] confirmCB:", this.confirmCB);
|
|
554
|
+
console.log("[BaseConfirm] should function:", should);
|
|
555
|
+
let testFn;
|
|
556
|
+
if (typeof this.confirmCB === "function") {
|
|
557
|
+
const potentialTestFn = this.confirmCB();
|
|
558
|
+
if (typeof potentialTestFn === "function") {
|
|
559
|
+
testFn = potentialTestFn;
|
|
560
|
+
} else {
|
|
561
|
+
testFn = this.confirmCB;
|
|
562
|
+
}
|
|
563
|
+
} else {
|
|
564
|
+
testFn = this.confirmCB;
|
|
565
|
+
}
|
|
566
|
+
const actualResult = Array.isArray(input) ? testFn(...input) : testFn(input);
|
|
567
|
+
console.log("[BaseConfirm] actualResult:", actualResult);
|
|
568
|
+
const passed = should(actualResult);
|
|
569
|
+
tester(passed);
|
|
570
|
+
} else if (should && typeof should.processRow === "function") {
|
|
571
|
+
const actualResult = Array.isArray(input) ? this.confirmCB(...input) : this.confirmCB(input);
|
|
572
|
+
console.log("[BaseConfirm] actualResult:", actualResult);
|
|
573
|
+
const passed = await should.processRow(
|
|
574
|
+
actualResult,
|
|
575
|
+
testResourceConfiguration,
|
|
576
|
+
artifactory
|
|
577
|
+
);
|
|
578
|
+
tester(passed);
|
|
579
|
+
} else {
|
|
580
|
+
tester(true);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
} catch (e) {
|
|
584
|
+
CommonUtils.handleTestError(e, this);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
577
587
|
} catch (e) {
|
|
578
|
-
|
|
579
|
-
this.error = true;
|
|
580
|
-
throw e;
|
|
588
|
+
CommonUtils.handleTestError(e, this);
|
|
581
589
|
}
|
|
590
|
+
return this.store;
|
|
591
|
+
}
|
|
592
|
+
// Alias for run to match BaseSuite expectations
|
|
593
|
+
async run(subject, testResourceConfiguration, artifactory) {
|
|
594
|
+
return this.confirm(
|
|
595
|
+
subject,
|
|
596
|
+
this.key || "confirm",
|
|
597
|
+
testResourceConfiguration,
|
|
598
|
+
(t) => !!t,
|
|
599
|
+
artifactory
|
|
600
|
+
);
|
|
582
601
|
}
|
|
583
602
|
};
|
|
584
603
|
|
|
585
|
-
// src/
|
|
586
|
-
var
|
|
587
|
-
constructor(name,
|
|
588
|
-
|
|
589
|
-
this.
|
|
604
|
+
// src/verbs/tdt/BaseExpected.ts
|
|
605
|
+
var BaseExpected = class {
|
|
606
|
+
constructor(name, expectedCB) {
|
|
607
|
+
this.expectedValue = null;
|
|
608
|
+
this.error = null;
|
|
609
|
+
this.name = name;
|
|
610
|
+
this.expectedCB = expectedCB;
|
|
611
|
+
}
|
|
612
|
+
// Set expected value for current row
|
|
613
|
+
setExpectedValue(expected) {
|
|
614
|
+
this.expectedValue = expected;
|
|
590
615
|
}
|
|
591
616
|
async test(store, testResourceConfiguration, filepath, artifactory) {
|
|
592
617
|
try {
|
|
593
|
-
const
|
|
594
|
-
store,
|
|
595
|
-
async (s) => {
|
|
596
|
-
try {
|
|
597
|
-
if (typeof this.thenCB === "function") {
|
|
598
|
-
const result = await this.thenCB(s);
|
|
599
|
-
return result;
|
|
600
|
-
} else {
|
|
601
|
-
return this.thenCB;
|
|
602
|
-
}
|
|
603
|
-
} catch (e) {
|
|
604
|
-
this.error = true;
|
|
605
|
-
throw e;
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
testResourceConfiguration,
|
|
609
|
-
artifactory
|
|
610
|
-
);
|
|
618
|
+
const result = await this.expectedCB(store);
|
|
611
619
|
this.status = true;
|
|
612
|
-
return
|
|
620
|
+
return result;
|
|
613
621
|
} catch (e) {
|
|
614
622
|
this.status = false;
|
|
615
|
-
this.error =
|
|
623
|
+
this.error = e;
|
|
616
624
|
throw e;
|
|
617
625
|
}
|
|
618
626
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
},
|
|
626
|
-
prepareEach: async function(subject, initializer, testResource, initialValues, artifactory) {
|
|
627
|
-
return subject;
|
|
628
|
-
},
|
|
629
|
-
cleanupEach: async (store, key, artifactory) => Promise.resolve(store),
|
|
630
|
-
cleanupAll: (store, artifactory) => void 0,
|
|
631
|
-
verify: async (store, checkCb, testResource, artifactory) => {
|
|
632
|
-
return checkCb(store);
|
|
633
|
-
},
|
|
634
|
-
execute: async (store, actionCB, testResource, artifactory) => {
|
|
635
|
-
return actionCB(store);
|
|
636
|
-
},
|
|
637
|
-
assert: (x) => x
|
|
638
|
-
});
|
|
639
|
-
var DefaultAdapter = (p) => {
|
|
640
|
-
const base = BaseAdapter();
|
|
641
|
-
const mapped = { ...p };
|
|
642
|
-
if (p.beforeAll && !p.prepareAll) {
|
|
643
|
-
mapped.prepareAll = async (input, testResource, artifactory) => {
|
|
644
|
-
if (p.beforeAll.length >= 3) {
|
|
645
|
-
return await p.beforeAll(input, testResource, artifactory);
|
|
646
|
-
} else if (p.beforeAll.length >= 2) {
|
|
647
|
-
return await p.beforeAll(input, testResource);
|
|
648
|
-
} else {
|
|
649
|
-
return await p.beforeAll(input);
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
if (p.beforeEach && !p.prepareEach) {
|
|
654
|
-
mapped.prepareEach = async (subject, initializer, testResource, initialValues, artifactory) => {
|
|
655
|
-
if (p.beforeEach.length >= 5) {
|
|
656
|
-
return await p.beforeEach(subject, initializer, testResource, initialValues, artifactory);
|
|
657
|
-
} else if (p.beforeEach.length >= 4) {
|
|
658
|
-
return await p.beforeEach(subject, initializer, testResource, initialValues);
|
|
659
|
-
} else if (p.beforeEach.length >= 3) {
|
|
660
|
-
return await p.beforeEach(subject, initializer, testResource);
|
|
661
|
-
} else if (p.beforeEach.length >= 2) {
|
|
662
|
-
return await p.beforeEach(subject, initializer);
|
|
663
|
-
} else {
|
|
664
|
-
return await p.beforeEach(subject);
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
if (p.afterEach && !p.cleanupEach) {
|
|
669
|
-
mapped.cleanupEach = async (store, key, artifactory) => {
|
|
670
|
-
if (p.afterEach.length >= 3) {
|
|
671
|
-
return await p.afterEach(store, key, artifactory);
|
|
672
|
-
} else if (p.afterEach.length >= 2) {
|
|
673
|
-
return await p.afterEach(store, key);
|
|
674
|
-
} else {
|
|
675
|
-
return await p.afterEach(store);
|
|
676
|
-
}
|
|
627
|
+
toObj() {
|
|
628
|
+
return {
|
|
629
|
+
name: this.name,
|
|
630
|
+
status: this.status,
|
|
631
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null,
|
|
632
|
+
expectedValue: this.expectedValue
|
|
677
633
|
};
|
|
678
634
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
// src/verbs/tdt/BaseShould.ts
|
|
638
|
+
var BaseShould = class {
|
|
639
|
+
constructor(name, shouldCB) {
|
|
640
|
+
this.currentRow = [];
|
|
641
|
+
this.rowIndex = -1;
|
|
642
|
+
this.error = null;
|
|
643
|
+
this.name = name;
|
|
644
|
+
this.shouldCB = shouldCB;
|
|
687
645
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
} else if (p.andWhen.length >= 3) {
|
|
693
|
-
return await p.andWhen(store, actionCB, testResource);
|
|
694
|
-
} else if (p.andWhen.length >= 2) {
|
|
695
|
-
return await p.andWhen(store, actionCB);
|
|
696
|
-
} else {
|
|
697
|
-
return await p.andWhen(store);
|
|
698
|
-
}
|
|
699
|
-
};
|
|
646
|
+
// Set current row data
|
|
647
|
+
setRowData(rowIndex, rowData) {
|
|
648
|
+
this.rowIndex = rowIndex;
|
|
649
|
+
this.currentRow = rowData;
|
|
700
650
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return await p.butThen(store, checkCB);
|
|
651
|
+
// Process the current row
|
|
652
|
+
async processRow(actualResult, testResourceConfiguration, artifactory) {
|
|
653
|
+
try {
|
|
654
|
+
let success = false;
|
|
655
|
+
if (typeof this.shouldCB === "function") {
|
|
656
|
+
const result = await this.shouldCB(actualResult);
|
|
657
|
+
success = !!result;
|
|
709
658
|
} else {
|
|
710
|
-
|
|
659
|
+
success = actualResult === this.shouldCB;
|
|
711
660
|
}
|
|
712
|
-
|
|
661
|
+
this.status = success;
|
|
662
|
+
return success;
|
|
663
|
+
} catch (e) {
|
|
664
|
+
this.status = false;
|
|
665
|
+
this.error = e;
|
|
666
|
+
throw e;
|
|
667
|
+
}
|
|
713
668
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
669
|
+
toObj() {
|
|
670
|
+
return {
|
|
671
|
+
name: this.name,
|
|
672
|
+
status: this.status,
|
|
673
|
+
error: this.error ? `${this.error.name}: ${this.error.message}` : null,
|
|
674
|
+
rowIndex: this.rowIndex,
|
|
675
|
+
currentRow: this.currentRow
|
|
721
676
|
};
|
|
722
677
|
}
|
|
723
|
-
return {
|
|
724
|
-
...base,
|
|
725
|
-
...mapped
|
|
726
|
-
};
|
|
727
678
|
};
|
|
728
679
|
|
|
729
|
-
// src/
|
|
730
|
-
var
|
|
731
|
-
constructor(
|
|
732
|
-
this.
|
|
733
|
-
this.testResourceConfiguration = null;
|
|
734
|
-
this.index = 0;
|
|
680
|
+
// src/verbs/tdt/BaseValue.ts
|
|
681
|
+
var BaseValue = class {
|
|
682
|
+
constructor(features, tableRows, confirmCB, initialValues) {
|
|
683
|
+
this.key = "";
|
|
735
684
|
this.failed = false;
|
|
736
|
-
this.fails = 0;
|
|
737
|
-
this.parent = null;
|
|
738
|
-
// Reference to parent BaseTiposkripto instance
|
|
739
685
|
this.artifacts = [];
|
|
740
|
-
const suiteName = name || "testSuite";
|
|
741
|
-
if (!suiteName) {
|
|
742
|
-
throw new Error("BaseSuite requires a non-empty name");
|
|
743
|
-
}
|
|
744
|
-
this.name = suiteName;
|
|
745
|
-
this.index = index;
|
|
746
|
-
this.givens = givens;
|
|
747
686
|
this.fails = 0;
|
|
748
|
-
this.
|
|
687
|
+
this.error = null;
|
|
688
|
+
this.store = null;
|
|
689
|
+
this.testResourceConfiguration = null;
|
|
690
|
+
this.features = features;
|
|
691
|
+
this.tableRows = tableRows;
|
|
692
|
+
this.confirmCB = confirmCB;
|
|
693
|
+
this.initialValues = initialValues;
|
|
694
|
+
}
|
|
695
|
+
setParent(parent) {
|
|
696
|
+
this._parent = parent;
|
|
749
697
|
}
|
|
750
698
|
addArtifact(path2) {
|
|
751
|
-
|
|
752
|
-
throw new Error(
|
|
753
|
-
`[ARTIFACT ERROR] Expected string, got ${typeof path2}: ${JSON.stringify(
|
|
754
|
-
path2
|
|
755
|
-
)}`
|
|
756
|
-
);
|
|
757
|
-
}
|
|
758
|
-
const normalizedPath = path2.replace(/\\/g, "/");
|
|
759
|
-
this.artifacts.push(normalizedPath);
|
|
699
|
+
CommonUtils.addArtifact(this.artifacts, path2);
|
|
760
700
|
}
|
|
761
|
-
|
|
701
|
+
async value(subject, key, testResourceConfiguration, tester, artifactory, suiteNdx) {
|
|
702
|
+
this.key = key;
|
|
703
|
+
this.fails = 0;
|
|
704
|
+
this.testResourceConfiguration = testResourceConfiguration;
|
|
705
|
+
const actualArtifactory = artifactory || ((fPath, value) => {
|
|
706
|
+
});
|
|
707
|
+
const valueArtifactory = (fPath, value) => actualArtifactory(`value-${key}/${fPath}`, value);
|
|
762
708
|
try {
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
709
|
+
const result = this.confirmCB();
|
|
710
|
+
if (typeof result === "function") {
|
|
711
|
+
this.store = await result();
|
|
712
|
+
} else {
|
|
713
|
+
this.store = await result;
|
|
714
|
+
}
|
|
715
|
+
this.status = true;
|
|
716
|
+
} catch (e) {
|
|
717
|
+
this.status = false;
|
|
718
|
+
this.failed = true;
|
|
719
|
+
this.fails++;
|
|
720
|
+
this.error = e;
|
|
721
|
+
return this.store;
|
|
722
|
+
}
|
|
723
|
+
try {
|
|
724
|
+
for (const [rowIndex, row] of (this.tableRows || []).entries()) {
|
|
725
|
+
try {
|
|
726
|
+
const rowArtifactory = this.createArtifactoryForRow(
|
|
727
|
+
key,
|
|
728
|
+
rowIndex,
|
|
729
|
+
suiteNdx
|
|
730
|
+
);
|
|
731
|
+
const rowResult = await this.processRow(
|
|
732
|
+
row,
|
|
733
|
+
rowIndex,
|
|
734
|
+
rowArtifactory,
|
|
735
|
+
testResourceConfiguration
|
|
736
|
+
);
|
|
737
|
+
if (rowResult !== void 0) {
|
|
738
|
+
tester(rowResult);
|
|
739
|
+
}
|
|
740
|
+
} catch (e) {
|
|
741
|
+
this.failed = true;
|
|
742
|
+
this.fails++;
|
|
743
|
+
this.error = e;
|
|
773
744
|
}
|
|
774
|
-
}
|
|
775
|
-
return stringFeatures || [];
|
|
745
|
+
}
|
|
776
746
|
} catch (e) {
|
|
777
|
-
|
|
778
|
-
|
|
747
|
+
this.error = e;
|
|
748
|
+
this.failed = true;
|
|
749
|
+
this.fails++;
|
|
750
|
+
} finally {
|
|
751
|
+
try {
|
|
752
|
+
await this.afterEach(this.store, this.key, valueArtifactory);
|
|
753
|
+
} catch (e) {
|
|
754
|
+
this.failed = true;
|
|
755
|
+
this.fails++;
|
|
756
|
+
this.error = e;
|
|
757
|
+
}
|
|
779
758
|
}
|
|
759
|
+
return this.store;
|
|
780
760
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
761
|
+
async processRow(row, rowIndex, artifactory, testResourceConfiguration) {
|
|
762
|
+
return row;
|
|
763
|
+
}
|
|
764
|
+
createArtifactoryForRow(key, rowIndex, suiteNdx) {
|
|
765
|
+
const self = this;
|
|
766
|
+
if (self._parent && self._parent.createArtifactory) {
|
|
767
|
+
return self._parent.createArtifactory({
|
|
768
|
+
valueKey: key,
|
|
769
|
+
rowIndex,
|
|
770
|
+
suiteIndex: suiteNdx
|
|
771
|
+
});
|
|
772
|
+
}
|
|
786
773
|
return {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
774
|
+
writeFileSync: (filename, payload) => {
|
|
775
|
+
let path2 = "";
|
|
776
|
+
if (suiteNdx !== void 0) {
|
|
777
|
+
path2 += `suite-${suiteNdx}/`;
|
|
778
|
+
}
|
|
779
|
+
path2 += `value-${key}/`;
|
|
780
|
+
path2 += `row-${rowIndex} ${filename}`;
|
|
781
|
+
console.log(`[Artifactory] Would write to: ${path2}`);
|
|
782
|
+
console.log(`[Artifactory] Content: ${payload.substring(0, 100)}...`);
|
|
783
|
+
},
|
|
784
|
+
screenshot: (filename, payload) => {
|
|
785
|
+
console.log(`[Artifactory] Would take screenshot: ${filename}`);
|
|
786
|
+
}
|
|
793
787
|
};
|
|
794
788
|
}
|
|
795
|
-
|
|
796
|
-
console.log("mark9");
|
|
797
|
-
return new Promise((res) => res(s));
|
|
798
|
-
}
|
|
799
|
-
assertThat(t) {
|
|
800
|
-
return !!t;
|
|
801
|
-
}
|
|
802
|
-
afterAll(store, artifactory) {
|
|
789
|
+
async afterEach(store, key, artifactory) {
|
|
803
790
|
return store;
|
|
804
791
|
}
|
|
805
|
-
|
|
806
|
-
this.
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration);
|
|
827
|
-
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
828
|
-
const giver = this.givens[gKey];
|
|
829
|
-
try {
|
|
830
|
-
let givenArtifactory;
|
|
831
|
-
if (this.parent && this.parent.createArtifactory) {
|
|
832
|
-
givenArtifactory = this.parent.createArtifactory({
|
|
833
|
-
givenKey: gKey,
|
|
834
|
-
suiteIndex: sNdx
|
|
835
|
-
});
|
|
836
|
-
} else {
|
|
837
|
-
const basePath = this.testResourceConfiguration?.fs || "testeranto";
|
|
838
|
-
givenArtifactory = {
|
|
839
|
-
writeFileSync: (filename, payload) => {
|
|
840
|
-
const path2 = `suite-${sNdx}/given-${gKey}/${filename}`;
|
|
841
|
-
const fullPath = `${basePath}/${path2}`;
|
|
842
|
-
console.log(`[BaseSuite] Would write to ${fullPath}: ${payload.substring(0, 100)}...`);
|
|
843
|
-
},
|
|
844
|
-
screenshot: (filename, payload) => {
|
|
845
|
-
console.log(`[BaseSuite] Would take screenshot: ${filename}`);
|
|
846
|
-
}
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
this.store = await giver.give(
|
|
850
|
-
subject,
|
|
851
|
-
gKey,
|
|
852
|
-
testResourceConfiguration,
|
|
853
|
-
this.assertThat,
|
|
854
|
-
givenArtifactory,
|
|
855
|
-
sNdx
|
|
856
|
-
);
|
|
857
|
-
this.fails += giver.fails || 0;
|
|
858
|
-
} catch (e) {
|
|
859
|
-
this.failed = true;
|
|
860
|
-
this.fails += 1;
|
|
861
|
-
if (giver.fails) {
|
|
862
|
-
this.fails += giver.fails;
|
|
863
|
-
}
|
|
864
|
-
console.error(`Error in given ${gKey}:`, e);
|
|
792
|
+
toObj() {
|
|
793
|
+
const processedRows = (this.tableRows || []).map((row) => {
|
|
794
|
+
if (Array.isArray(row)) {
|
|
795
|
+
return row.map((item) => {
|
|
796
|
+
if (item && typeof item === "object") {
|
|
797
|
+
if (item.toObj) {
|
|
798
|
+
return item.toObj();
|
|
799
|
+
}
|
|
800
|
+
const result = {};
|
|
801
|
+
for (const [key, value] of Object.entries(item)) {
|
|
802
|
+
if (key !== "_parent" && key !== "testResourceConfiguration") {
|
|
803
|
+
result[key] = value;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return result;
|
|
807
|
+
}
|
|
808
|
+
return item;
|
|
809
|
+
});
|
|
865
810
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
this.
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
811
|
+
return row;
|
|
812
|
+
});
|
|
813
|
+
return {
|
|
814
|
+
key: this.key,
|
|
815
|
+
values: processedRows,
|
|
816
|
+
tableRows: this.tableRows || [],
|
|
817
|
+
error: this.error ? [this.error, this.error.stack] : null,
|
|
818
|
+
failed: this.failed,
|
|
819
|
+
features: this.features || [],
|
|
820
|
+
artifacts: this.artifacts,
|
|
821
|
+
status: this.status
|
|
822
|
+
};
|
|
876
823
|
}
|
|
877
824
|
};
|
|
878
825
|
|
|
879
|
-
// src/types.ts
|
|
880
|
-
var defaultTestResourceRequirement = {
|
|
881
|
-
ports: 0
|
|
882
|
-
};
|
|
883
|
-
|
|
884
826
|
// src/BaseTiposkripto.ts
|
|
885
827
|
var BaseTiposkripto = class {
|
|
886
|
-
constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration
|
|
828
|
+
constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration) {
|
|
887
829
|
this.totalTests = 0;
|
|
888
830
|
this.artifacts = [];
|
|
889
|
-
this.assertThis = () => {
|
|
890
|
-
};
|
|
891
831
|
this.testResourceConfiguration = testResourceConfiguration;
|
|
892
832
|
const fullAdapter = DefaultAdapter(testAdapter);
|
|
893
833
|
const instance = this;
|
|
894
|
-
|
|
895
|
-
throw new Error(
|
|
896
|
-
`testImplementation.suites must be an object, got ${typeof testImplementation.suites}: ${JSON.stringify(
|
|
897
|
-
testImplementation.suites
|
|
898
|
-
)}`
|
|
899
|
-
);
|
|
900
|
-
}
|
|
901
|
-
const classySuites = Object.entries(testImplementation.suites).reduce(
|
|
902
|
-
(a, [key], index) => {
|
|
903
|
-
a[key] = (somestring, setups) => {
|
|
904
|
-
const capturedFullAdapter = fullAdapter;
|
|
905
|
-
return new class extends BaseSuite {
|
|
906
|
-
afterAll(store, artifactory) {
|
|
907
|
-
let suiteArtifactory = artifactory;
|
|
908
|
-
if (!suiteArtifactory) {
|
|
909
|
-
if (this.parent && this.parent.createArtifactory) {
|
|
910
|
-
suiteArtifactory = this.parent.createArtifactory({
|
|
911
|
-
suiteIndex: this.index
|
|
912
|
-
});
|
|
913
|
-
} else {
|
|
914
|
-
suiteArtifactory = instance.createArtifactory({
|
|
915
|
-
suiteIndex: this.index
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return capturedFullAdapter.cleanupAll(store, suiteArtifactory);
|
|
920
|
-
}
|
|
921
|
-
assertThat(t) {
|
|
922
|
-
return capturedFullAdapter.assert(t);
|
|
923
|
-
}
|
|
924
|
-
async setup(s, artifactory, tr) {
|
|
925
|
-
return capturedFullAdapter.prepareAll?.(s, tr, artifactory) ?? s;
|
|
926
|
-
}
|
|
927
|
-
}(somestring, index, setups, instance);
|
|
928
|
-
};
|
|
929
|
-
return a;
|
|
930
|
-
},
|
|
931
|
-
{}
|
|
932
|
-
);
|
|
834
|
+
const classySuites = {};
|
|
933
835
|
const classyGivens = {};
|
|
934
836
|
if (testImplementation.givens) {
|
|
935
837
|
Object.entries(testImplementation.givens).forEach(([key, g]) => {
|
|
@@ -974,52 +876,65 @@ var BaseTiposkripto = class {
|
|
|
974
876
|
}
|
|
975
877
|
const classyWhens = {};
|
|
976
878
|
if (testImplementation.whens) {
|
|
977
|
-
Object.entries(testImplementation.whens).forEach(
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
879
|
+
Object.entries(testImplementation.whens).forEach(
|
|
880
|
+
([key, whEn]) => {
|
|
881
|
+
classyWhens[key] = (...payload) => {
|
|
882
|
+
const capturedFullAdapter = fullAdapter;
|
|
883
|
+
const whenInstance = new class extends BaseWhen {
|
|
884
|
+
async andWhen(store, whenCB, testResource, artifactory) {
|
|
885
|
+
return await capturedFullAdapter.execute(
|
|
886
|
+
store,
|
|
887
|
+
whenCB,
|
|
888
|
+
testResource,
|
|
889
|
+
artifactory
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
}(`${key}: ${payload && payload.toString()}`, whEn(...payload));
|
|
893
|
+
return whenInstance;
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
);
|
|
993
897
|
}
|
|
994
898
|
const classyThens = {};
|
|
995
899
|
if (testImplementation.thens) {
|
|
996
|
-
Object.entries(testImplementation.thens).forEach(
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
900
|
+
Object.entries(testImplementation.thens).forEach(
|
|
901
|
+
([key, thEn]) => {
|
|
902
|
+
classyThens[key] = (...args) => {
|
|
903
|
+
const capturedFullAdapter = fullAdapter;
|
|
904
|
+
const thenInstance = new class extends BaseThen {
|
|
905
|
+
async butThen(store, thenCB, testResourceConfiguration2, artifactory) {
|
|
906
|
+
return capturedFullAdapter.verify(
|
|
907
|
+
store,
|
|
908
|
+
thenCB,
|
|
909
|
+
testResourceConfiguration2,
|
|
910
|
+
artifactory
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
}(`${key}: ${args && args.toString()}`, thEn(...args));
|
|
914
|
+
return thenInstance;
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
);
|
|
1012
918
|
}
|
|
1013
919
|
const classyConfirms = {};
|
|
1014
920
|
if (testImplementation.confirms) {
|
|
1015
921
|
Object.entries(testImplementation.confirms).forEach(([key, val]) => {
|
|
1016
|
-
classyConfirms[key] = (
|
|
1017
|
-
return
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
922
|
+
classyConfirms[key] = () => {
|
|
923
|
+
return (testCases, features) => {
|
|
924
|
+
let actualConfirmCB;
|
|
925
|
+
if (typeof val === "function") {
|
|
926
|
+
actualConfirmCB = val();
|
|
927
|
+
} else {
|
|
928
|
+
actualConfirmCB = val;
|
|
929
|
+
}
|
|
930
|
+
return new BaseConfirm(
|
|
931
|
+
features,
|
|
932
|
+
testCases,
|
|
933
|
+
actualConfirmCB,
|
|
934
|
+
void 0
|
|
935
|
+
// initialValues
|
|
936
|
+
);
|
|
937
|
+
};
|
|
1023
938
|
};
|
|
1024
939
|
});
|
|
1025
940
|
}
|
|
@@ -1038,40 +953,83 @@ var BaseTiposkripto = class {
|
|
|
1038
953
|
}
|
|
1039
954
|
const classyShoulds = {};
|
|
1040
955
|
if (testImplementation.shoulds) {
|
|
1041
|
-
Object.entries(testImplementation.shoulds).forEach(
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
956
|
+
Object.entries(testImplementation.shoulds).forEach(
|
|
957
|
+
([key, shouldCB]) => {
|
|
958
|
+
classyShoulds[key] = (...args) => {
|
|
959
|
+
return new BaseShould(
|
|
960
|
+
`${key}: ${args && args.toString()}`,
|
|
961
|
+
shouldCB(...args)
|
|
962
|
+
);
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
);
|
|
1046
966
|
}
|
|
1047
967
|
const classyExpecteds = {};
|
|
1048
968
|
if (testImplementation.expecteds) {
|
|
1049
|
-
Object.entries(testImplementation.expecteds).forEach(
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
969
|
+
Object.entries(testImplementation.expecteds).forEach(
|
|
970
|
+
([key, expectedCB]) => {
|
|
971
|
+
classyExpecteds[key] = (...args) => {
|
|
972
|
+
return new BaseExpected(
|
|
973
|
+
`${key}: ${args && args.toString()}`,
|
|
974
|
+
expectedCB(...args)
|
|
975
|
+
);
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
);
|
|
1054
979
|
}
|
|
1055
980
|
const classyDescribes = {};
|
|
1056
|
-
if (testImplementation.describes) {
|
|
981
|
+
if (testImplementation.describes && typeof testImplementation.describes === "object") {
|
|
1057
982
|
Object.entries(testImplementation.describes).forEach(([key, desc]) => {
|
|
1058
983
|
classyDescribes[key] = (features, its, describeCB, initialValues) => {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
984
|
+
try {
|
|
985
|
+
let actualDescribeCB;
|
|
986
|
+
if (describeCB) {
|
|
987
|
+
actualDescribeCB = describeCB;
|
|
988
|
+
} else if (typeof desc === "function") {
|
|
989
|
+
actualDescribeCB = desc();
|
|
990
|
+
} else {
|
|
991
|
+
actualDescribeCB = desc;
|
|
992
|
+
}
|
|
993
|
+
if (typeof actualDescribeCB !== "function") {
|
|
994
|
+
console.warn(`Describe implementation for "${key}" is not a function, got:`, typeof actualDescribeCB);
|
|
995
|
+
actualDescribeCB = () => {
|
|
996
|
+
throw new Error(`Describe implementation for "${key}" is not a valid function`);
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
return new BaseDescribe(
|
|
1000
|
+
features,
|
|
1001
|
+
its,
|
|
1002
|
+
actualDescribeCB,
|
|
1003
|
+
initialValues
|
|
1004
|
+
);
|
|
1005
|
+
} catch (error) {
|
|
1006
|
+
console.error(`Error creating Describe for "${key}":`, error);
|
|
1007
|
+
return new BaseDescribe(
|
|
1008
|
+
features,
|
|
1009
|
+
its,
|
|
1010
|
+
() => {
|
|
1011
|
+
throw new Error(`Describe implementation for "${key}" failed: ${error.message}`);
|
|
1012
|
+
},
|
|
1013
|
+
initialValues
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1065
1016
|
};
|
|
1066
1017
|
});
|
|
1018
|
+
} else {
|
|
1019
|
+
console.warn("testImplementation.describes is not defined or not an object");
|
|
1067
1020
|
}
|
|
1068
1021
|
const classyIts = {};
|
|
1069
1022
|
if (testImplementation.its) {
|
|
1070
|
-
Object.entries(testImplementation.its).forEach(
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1023
|
+
Object.entries(testImplementation.its).forEach(
|
|
1024
|
+
([key, itCB]) => {
|
|
1025
|
+
classyIts[key] = (...args) => {
|
|
1026
|
+
return new BaseIt(
|
|
1027
|
+
`${key}: ${args && args.toString()}`,
|
|
1028
|
+
itCB(...args)
|
|
1029
|
+
);
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1075
1033
|
}
|
|
1076
1034
|
this.suitesOverrides = classySuites;
|
|
1077
1035
|
this.givenOverrides = classyGivens;
|
|
@@ -1085,76 +1043,192 @@ var BaseTiposkripto = class {
|
|
|
1085
1043
|
this.confirmsOverrides = classyConfirms;
|
|
1086
1044
|
this.testResourceRequirement = testResourceRequirement;
|
|
1087
1045
|
this.testSpecification = testSpecification;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1046
|
+
let topLevelVerbs = [];
|
|
1047
|
+
let specError = null;
|
|
1048
|
+
try {
|
|
1049
|
+
topLevelVerbs = testSpecification(
|
|
1050
|
+
this.Given(),
|
|
1051
|
+
this.When(),
|
|
1052
|
+
this.Then(),
|
|
1053
|
+
this.Describe(),
|
|
1054
|
+
this.It(),
|
|
1055
|
+
this.Confirm(),
|
|
1056
|
+
this.Value(),
|
|
1057
|
+
this.Should()
|
|
1058
|
+
);
|
|
1059
|
+
} catch (error) {
|
|
1060
|
+
console.error("Error during test specification:", error);
|
|
1061
|
+
specError = error;
|
|
1062
|
+
topLevelVerbs = [];
|
|
1063
|
+
}
|
|
1064
|
+
this.specs = topLevelVerbs;
|
|
1065
|
+
this.totalTests = this.calculateTotalTestsDirectly();
|
|
1066
|
+
this.testJobs = [];
|
|
1067
|
+
for (let index = 0; index < this.specs.length; index++) {
|
|
1068
|
+
const step = this.specs[index];
|
|
1069
|
+
try {
|
|
1070
|
+
const testJob = this.createTestJobForStep(step, index, input);
|
|
1071
|
+
this.testJobs.push(testJob);
|
|
1072
|
+
} catch (stepError) {
|
|
1073
|
+
console.error(`Error creating test job for step ${index}:`, stepError);
|
|
1074
|
+
const errorMessage = `Step ${index} failed to create test job: ${stepError.message}`;
|
|
1075
|
+
const errorStep = {
|
|
1076
|
+
constructor: { name: "ErrorStep" },
|
|
1077
|
+
features: [],
|
|
1078
|
+
artifacts: [],
|
|
1079
|
+
fails: 1,
|
|
1080
|
+
failed: true,
|
|
1081
|
+
error: new Error(errorMessage),
|
|
1082
|
+
toObj: () => ({
|
|
1083
|
+
name: `Step_${index}_Error`,
|
|
1084
|
+
type: "Error",
|
|
1085
|
+
error: errorMessage
|
|
1086
|
+
})
|
|
1087
|
+
};
|
|
1088
|
+
const errorTestJob = this.createErrorTestJob(errorStep, index, new Error(errorMessage));
|
|
1089
|
+
this.testJobs.push(errorTestJob);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
if (this.testJobs.length === 0) {
|
|
1093
|
+
const errorMessage = specError ? `Test specification failed: ${specError.message}` : "No test steps were created by the specification";
|
|
1094
|
+
const errorStep = {
|
|
1095
|
+
constructor: { name: "ErrorStep" },
|
|
1096
|
+
features: [],
|
|
1097
|
+
artifacts: [],
|
|
1098
|
+
fails: 1,
|
|
1099
|
+
failed: true,
|
|
1100
|
+
error: new Error(errorMessage),
|
|
1101
|
+
toObj: () => ({
|
|
1102
|
+
name: "Specification_Error",
|
|
1103
|
+
type: "Error",
|
|
1104
|
+
error: errorMessage
|
|
1105
|
+
})
|
|
1110
1106
|
};
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1107
|
+
const errorTestJob = this.createErrorTestJob(errorStep, 0, new Error(errorMessage));
|
|
1108
|
+
this.testJobs.push(errorTestJob);
|
|
1109
|
+
}
|
|
1110
|
+
if (this.testJobs.length > 0) {
|
|
1111
|
+
const runAllTests = async () => {
|
|
1112
|
+
const allResults = [];
|
|
1113
|
+
let totalFails = 0;
|
|
1114
|
+
let anyFailed = false;
|
|
1115
|
+
const allFeatures = [];
|
|
1116
|
+
const allArtifacts = [];
|
|
1117
|
+
for (let i = 0; i < this.testJobs.length; i++) {
|
|
1120
1118
|
try {
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
tests: 0,
|
|
1132
|
-
runTimeTests: totalTests,
|
|
1133
|
-
testJob: testJob.toObj()
|
|
1134
|
-
};
|
|
1119
|
+
const result = await this.testJobs[i].receiveTestResourceConfig(testResourceConfiguration);
|
|
1120
|
+
allResults.push(result);
|
|
1121
|
+
totalFails += result.fails;
|
|
1122
|
+
anyFailed = anyFailed || result.failed;
|
|
1123
|
+
if (result.features && Array.isArray(result.features)) {
|
|
1124
|
+
allFeatures.push(...result.features);
|
|
1125
|
+
}
|
|
1126
|
+
if (result.artifacts && Array.isArray(result.artifacts)) {
|
|
1127
|
+
allArtifacts.push(...result.artifacts);
|
|
1128
|
+
}
|
|
1135
1129
|
} catch (e) {
|
|
1136
|
-
console.error(e
|
|
1137
|
-
|
|
1130
|
+
console.error(`Error running test job ${i}:`, e);
|
|
1131
|
+
totalFails++;
|
|
1132
|
+
anyFailed = true;
|
|
1133
|
+
allResults.push({
|
|
1138
1134
|
failed: true,
|
|
1139
|
-
fails:
|
|
1140
|
-
artifacts: [],
|
|
1135
|
+
fails: 1,
|
|
1141
1136
|
features: [],
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1137
|
+
artifacts: [],
|
|
1138
|
+
error: {
|
|
1139
|
+
message: e.message,
|
|
1140
|
+
stack: e.stack,
|
|
1141
|
+
name: e.name
|
|
1142
|
+
},
|
|
1143
|
+
stepName: `Job_${i}`,
|
|
1144
|
+
stepType: "Error",
|
|
1145
|
+
testJob: { name: `Job_${i}_Error` }
|
|
1146
|
+
});
|
|
1146
1147
|
}
|
|
1147
1148
|
}
|
|
1149
|
+
const combinedResults = {
|
|
1150
|
+
failed: anyFailed,
|
|
1151
|
+
fails: totalFails,
|
|
1152
|
+
artifacts: allArtifacts,
|
|
1153
|
+
features: [...new Set(allFeatures)],
|
|
1154
|
+
// Remove duplicates
|
|
1155
|
+
tests: this.testJobs.length,
|
|
1156
|
+
runTimeTests: this.totalTests,
|
|
1157
|
+
testJob: { name: "CombinedResults" },
|
|
1158
|
+
timestamp: Date.now(),
|
|
1159
|
+
individualResults: allResults.map((result, idx) => ({
|
|
1160
|
+
index: idx,
|
|
1161
|
+
failed: result.failed,
|
|
1162
|
+
fails: result.fails,
|
|
1163
|
+
features: result.features || [],
|
|
1164
|
+
error: result.error,
|
|
1165
|
+
stepName: result.stepName,
|
|
1166
|
+
stepType: result.stepType,
|
|
1167
|
+
testJob: result.testJob
|
|
1168
|
+
}))
|
|
1169
|
+
};
|
|
1170
|
+
combinedResults.summary = {
|
|
1171
|
+
totalTests: this.testJobs.length,
|
|
1172
|
+
passed: this.testJobs.length - totalFails,
|
|
1173
|
+
failed: totalFails,
|
|
1174
|
+
successRate: totalFails === this.testJobs.length ? "0%" : ((this.testJobs.length - totalFails) / this.testJobs.length * 100).toFixed(2) + "%"
|
|
1175
|
+
};
|
|
1176
|
+
console.log("testResourceConfiguration", testResourceConfiguration);
|
|
1177
|
+
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1178
|
+
this.writeFileSync(reportJson, JSON.stringify(combinedResults, null, 2));
|
|
1179
|
+
};
|
|
1180
|
+
runAllTests().catch((error) => {
|
|
1181
|
+
console.error("Error running all test jobs:", error);
|
|
1182
|
+
const errorResults = {
|
|
1183
|
+
failed: true,
|
|
1184
|
+
fails: -1,
|
|
1185
|
+
artifacts: [],
|
|
1186
|
+
features: [],
|
|
1187
|
+
tests: 0,
|
|
1188
|
+
runTimeTests: -1,
|
|
1189
|
+
testJob: {},
|
|
1190
|
+
timestamp: Date.now(),
|
|
1191
|
+
error: {
|
|
1192
|
+
message: error.message,
|
|
1193
|
+
stack: error.stack,
|
|
1194
|
+
name: error.name
|
|
1195
|
+
},
|
|
1196
|
+
individualResults: [],
|
|
1197
|
+
summary: {
|
|
1198
|
+
totalTests: 0,
|
|
1199
|
+
passed: 0,
|
|
1200
|
+
failed: 1,
|
|
1201
|
+
successRate: "0%"
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1205
|
+
this.writeFileSync(reportJson, JSON.stringify(errorResults, null, 2));
|
|
1206
|
+
});
|
|
1207
|
+
} else {
|
|
1208
|
+
const emptyResults = {
|
|
1209
|
+
failed: true,
|
|
1210
|
+
fails: -1,
|
|
1211
|
+
artifacts: [],
|
|
1212
|
+
features: [],
|
|
1213
|
+
tests: 0,
|
|
1214
|
+
runTimeTests: -1,
|
|
1215
|
+
testJob: {},
|
|
1216
|
+
timestamp: Date.now(),
|
|
1217
|
+
error: {
|
|
1218
|
+
message: "No test jobs were created",
|
|
1219
|
+
name: "ConfigurationError"
|
|
1220
|
+
},
|
|
1221
|
+
individualResults: [],
|
|
1222
|
+
summary: {
|
|
1223
|
+
totalTests: 0,
|
|
1224
|
+
passed: 0,
|
|
1225
|
+
failed: 1,
|
|
1226
|
+
successRate: "0%"
|
|
1227
|
+
}
|
|
1148
1228
|
};
|
|
1149
|
-
return testJob;
|
|
1150
|
-
});
|
|
1151
|
-
this.testJobs[0].receiveTestResourceConfig(
|
|
1152
|
-
testResourceConfiguration
|
|
1153
|
-
).then((results) => {
|
|
1154
|
-
console.log("testResourceConfiguration", testResourceConfiguration);
|
|
1155
1229
|
const reportJson = `${testResourceConfiguration.fs}/tests.json`;
|
|
1156
|
-
this.writeFileSync(reportJson, JSON.stringify(
|
|
1157
|
-
}
|
|
1230
|
+
this.writeFileSync(reportJson, JSON.stringify(emptyResults, null, 2));
|
|
1231
|
+
}
|
|
1158
1232
|
}
|
|
1159
1233
|
// Create an artifactory that tracks context
|
|
1160
1234
|
createArtifactory(context = {}) {
|
|
@@ -1164,7 +1238,12 @@ var BaseTiposkripto = class {
|
|
|
1164
1238
|
const basePath = this.testResourceConfiguration?.fs || "testeranto";
|
|
1165
1239
|
console.log("[Artifactory] Base path:", basePath);
|
|
1166
1240
|
console.log("[Artifactory] Context:", context);
|
|
1167
|
-
if (context.
|
|
1241
|
+
if (context.stepIndex !== void 0) {
|
|
1242
|
+
path2 += `step-${context.stepIndex}/`;
|
|
1243
|
+
if (context.stepType) {
|
|
1244
|
+
path2 += `${context.stepType}/`;
|
|
1245
|
+
}
|
|
1246
|
+
} else if (context.suiteIndex !== void 0) {
|
|
1168
1247
|
path2 += `suite-${context.suiteIndex}/`;
|
|
1169
1248
|
}
|
|
1170
1249
|
if (context.givenKey) {
|
|
@@ -1192,7 +1271,56 @@ var BaseTiposkripto = class {
|
|
|
1192
1271
|
}
|
|
1193
1272
|
async receiveTestResourceConfig(testResourceConfig) {
|
|
1194
1273
|
if (this.testJobs && this.testJobs.length > 0) {
|
|
1195
|
-
|
|
1274
|
+
const allResults = [];
|
|
1275
|
+
let totalFails = 0;
|
|
1276
|
+
let anyFailed = false;
|
|
1277
|
+
const allFeatures = [];
|
|
1278
|
+
const allArtifacts = [];
|
|
1279
|
+
for (let i = 0; i < this.testJobs.length; i++) {
|
|
1280
|
+
try {
|
|
1281
|
+
const result = await this.testJobs[i].receiveTestResourceConfig(testResourceConfig);
|
|
1282
|
+
allResults.push(result);
|
|
1283
|
+
totalFails += result.fails;
|
|
1284
|
+
anyFailed = anyFailed || result.failed;
|
|
1285
|
+
if (result.features && Array.isArray(result.features)) {
|
|
1286
|
+
allFeatures.push(...result.features);
|
|
1287
|
+
}
|
|
1288
|
+
if (result.artifacts && Array.isArray(result.artifacts)) {
|
|
1289
|
+
allArtifacts.push(...result.artifacts);
|
|
1290
|
+
}
|
|
1291
|
+
} catch (e) {
|
|
1292
|
+
console.error(`Error running test job ${i}:`, e);
|
|
1293
|
+
totalFails++;
|
|
1294
|
+
anyFailed = true;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
return {
|
|
1298
|
+
failed: anyFailed,
|
|
1299
|
+
fails: totalFails,
|
|
1300
|
+
artifacts: allArtifacts,
|
|
1301
|
+
features: [...new Set(allFeatures)],
|
|
1302
|
+
// Remove duplicates
|
|
1303
|
+
tests: this.testJobs.length,
|
|
1304
|
+
runTimeTests: this.totalTests,
|
|
1305
|
+
testJob: { name: "CombinedResults" },
|
|
1306
|
+
timestamp: Date.now(),
|
|
1307
|
+
individualResults: allResults.map((result, idx) => ({
|
|
1308
|
+
index: idx,
|
|
1309
|
+
failed: result.failed,
|
|
1310
|
+
fails: result.fails,
|
|
1311
|
+
features: result.features || [],
|
|
1312
|
+
error: result.error,
|
|
1313
|
+
stepName: result.stepName,
|
|
1314
|
+
stepType: result.stepType,
|
|
1315
|
+
testJob: result.testJob
|
|
1316
|
+
})),
|
|
1317
|
+
summary: {
|
|
1318
|
+
totalTests: this.testJobs.length,
|
|
1319
|
+
passed: this.testJobs.length - totalFails,
|
|
1320
|
+
failed: totalFails,
|
|
1321
|
+
successRate: totalFails === 0 ? "100%" : ((this.testJobs.length - totalFails) / this.testJobs.length * 100).toFixed(2) + "%"
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1196
1324
|
} else {
|
|
1197
1325
|
throw new Error("No test jobs available");
|
|
1198
1326
|
}
|
|
@@ -1201,62 +1329,501 @@ var BaseTiposkripto = class {
|
|
|
1201
1329
|
return this.specs;
|
|
1202
1330
|
}
|
|
1203
1331
|
Suites() {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
`suitesOverrides is undefined. classySuites: ${JSON.stringify(
|
|
1207
|
-
Object.keys(this.suitesOverrides || {})
|
|
1208
|
-
)}`
|
|
1209
|
-
);
|
|
1210
|
-
}
|
|
1211
|
-
return this.suitesOverrides;
|
|
1332
|
+
console.warn("Suites() is deprecated and returns an empty object");
|
|
1333
|
+
return {};
|
|
1212
1334
|
}
|
|
1213
1335
|
Given() {
|
|
1214
|
-
|
|
1336
|
+
const overrides = this.givenOverrides || {};
|
|
1337
|
+
return new Proxy(overrides, {
|
|
1338
|
+
get(target, prop) {
|
|
1339
|
+
if (typeof prop === "string") {
|
|
1340
|
+
if (prop in target) {
|
|
1341
|
+
return target[prop];
|
|
1342
|
+
} else {
|
|
1343
|
+
return (features = [], whens = [], thens = [], givenCB = () => {
|
|
1344
|
+
}, initialValues = void 0) => {
|
|
1345
|
+
console.error(`Given.${prop} is not defined in test implementation`);
|
|
1346
|
+
try {
|
|
1347
|
+
return new class extends BaseGiven {
|
|
1348
|
+
async givenThat(subject, testResource, artifactory, initializer, initialValues2) {
|
|
1349
|
+
throw new Error(`Given.${prop} is not implemented`);
|
|
1350
|
+
}
|
|
1351
|
+
}(
|
|
1352
|
+
features,
|
|
1353
|
+
whens,
|
|
1354
|
+
thens,
|
|
1355
|
+
givenCB,
|
|
1356
|
+
initialValues
|
|
1357
|
+
);
|
|
1358
|
+
} catch (e) {
|
|
1359
|
+
console.error(`Error creating Given.${prop}:`, e);
|
|
1360
|
+
return {
|
|
1361
|
+
features,
|
|
1362
|
+
whens,
|
|
1363
|
+
thens,
|
|
1364
|
+
givenCB,
|
|
1365
|
+
initialValues,
|
|
1366
|
+
give: async () => {
|
|
1367
|
+
throw new Error(`Given.${prop} creation failed: ${e.message}`);
|
|
1368
|
+
},
|
|
1369
|
+
toObj: () => ({
|
|
1370
|
+
key: `Given_${prop}_error`,
|
|
1371
|
+
error: `Given.${prop} creation failed: ${e.message}`,
|
|
1372
|
+
failed: true,
|
|
1373
|
+
features
|
|
1374
|
+
})
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
return target[prop];
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1215
1383
|
}
|
|
1216
1384
|
When() {
|
|
1217
|
-
|
|
1385
|
+
const overrides = this.whenOverrides || {};
|
|
1386
|
+
return new Proxy(overrides, {
|
|
1387
|
+
get(target, prop) {
|
|
1388
|
+
if (typeof prop === "string") {
|
|
1389
|
+
if (prop in target) {
|
|
1390
|
+
return target[prop];
|
|
1391
|
+
} else {
|
|
1392
|
+
return (...args) => {
|
|
1393
|
+
console.error(`When.${prop} is not defined in test implementation`);
|
|
1394
|
+
try {
|
|
1395
|
+
return new class extends BaseWhen {
|
|
1396
|
+
async andWhen(store, whenCB, testResource, artifactory) {
|
|
1397
|
+
throw new Error(`When.${prop} is not implemented`);
|
|
1398
|
+
}
|
|
1399
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1400
|
+
throw new Error(`When.${prop} is not implemented`);
|
|
1401
|
+
});
|
|
1402
|
+
} catch (e) {
|
|
1403
|
+
console.error(`Error creating When.${prop}:`, e);
|
|
1404
|
+
return {
|
|
1405
|
+
name: `${prop}_error`,
|
|
1406
|
+
test: async () => {
|
|
1407
|
+
throw new Error(`When.${prop} creation failed: ${e.message}`);
|
|
1408
|
+
},
|
|
1409
|
+
toObj: () => ({
|
|
1410
|
+
name: `When_${prop}_error`,
|
|
1411
|
+
error: `When.${prop} creation failed: ${e.message}`,
|
|
1412
|
+
status: false
|
|
1413
|
+
})
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
return target[prop];
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1218
1422
|
}
|
|
1219
1423
|
Then() {
|
|
1220
|
-
|
|
1424
|
+
const overrides = this.thenOverrides || {};
|
|
1425
|
+
return new Proxy(overrides, {
|
|
1426
|
+
get(target, prop) {
|
|
1427
|
+
if (typeof prop === "string") {
|
|
1428
|
+
if (prop in target) {
|
|
1429
|
+
return target[prop];
|
|
1430
|
+
} else {
|
|
1431
|
+
return (...args) => {
|
|
1432
|
+
console.error(`Then.${prop} is not defined in test implementation`);
|
|
1433
|
+
return new class extends BaseThen {
|
|
1434
|
+
async butThen(store, thenCB, testResourceConfiguration, artifactory) {
|
|
1435
|
+
throw new Error(`Then.${prop} is not implemented`);
|
|
1436
|
+
}
|
|
1437
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1438
|
+
throw new Error(`Then.${prop} is not implemented`);
|
|
1439
|
+
});
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
return target[prop];
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1221
1446
|
}
|
|
1222
1447
|
Describe() {
|
|
1223
|
-
|
|
1448
|
+
const overrides = this.describesOverrides || {};
|
|
1449
|
+
return new Proxy(overrides, {
|
|
1450
|
+
get(target, prop) {
|
|
1451
|
+
if (typeof prop === "string") {
|
|
1452
|
+
if (prop in target) {
|
|
1453
|
+
return target[prop];
|
|
1454
|
+
} else {
|
|
1455
|
+
return () => {
|
|
1456
|
+
console.error(`Describe.${prop} is not defined in test implementation`);
|
|
1457
|
+
return (features, its, describeCB, initialValues) => {
|
|
1458
|
+
return new BaseDescribe(
|
|
1459
|
+
features,
|
|
1460
|
+
its,
|
|
1461
|
+
() => {
|
|
1462
|
+
throw new Error(`Describe.${prop} is not implemented`);
|
|
1463
|
+
},
|
|
1464
|
+
initialValues
|
|
1465
|
+
);
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
return target[prop];
|
|
1471
|
+
}
|
|
1472
|
+
});
|
|
1224
1473
|
}
|
|
1225
1474
|
It() {
|
|
1226
|
-
|
|
1475
|
+
const overrides = this.itsOverrides || {};
|
|
1476
|
+
return new Proxy(overrides, {
|
|
1477
|
+
get(target, prop) {
|
|
1478
|
+
if (typeof prop === "string") {
|
|
1479
|
+
if (prop in target) {
|
|
1480
|
+
return target[prop];
|
|
1481
|
+
} else {
|
|
1482
|
+
return (...args) => {
|
|
1483
|
+
console.error(`It.${prop} is not defined in test implementation`);
|
|
1484
|
+
return new class extends BaseIt {
|
|
1485
|
+
constructor(name, itCB) {
|
|
1486
|
+
super(name, itCB);
|
|
1487
|
+
}
|
|
1488
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1489
|
+
throw new Error(`It.${prop} is not implemented`);
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
return target[prop];
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1227
1497
|
}
|
|
1228
1498
|
Confirm() {
|
|
1229
|
-
|
|
1499
|
+
const overrides = this.confirmsOverrides || {};
|
|
1500
|
+
return new Proxy(overrides, {
|
|
1501
|
+
get(target, prop) {
|
|
1502
|
+
if (typeof prop === "string") {
|
|
1503
|
+
if (prop in target) {
|
|
1504
|
+
return target[prop];
|
|
1505
|
+
} else {
|
|
1506
|
+
return () => {
|
|
1507
|
+
console.error(`Confirm.${prop} is not defined in test implementation`);
|
|
1508
|
+
return (testCases, features) => {
|
|
1509
|
+
return new class extends BaseConfirm {
|
|
1510
|
+
constructor(features2, testCases2, confirmCB, initialValues) {
|
|
1511
|
+
super(features2, testCases2, confirmCB, initialValues);
|
|
1512
|
+
}
|
|
1513
|
+
}(
|
|
1514
|
+
features,
|
|
1515
|
+
testCases,
|
|
1516
|
+
() => {
|
|
1517
|
+
throw new Error(`Confirm.${prop} is not implemented`);
|
|
1518
|
+
},
|
|
1519
|
+
void 0
|
|
1520
|
+
);
|
|
1521
|
+
};
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
return target[prop];
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1230
1528
|
}
|
|
1231
1529
|
Value() {
|
|
1232
|
-
|
|
1530
|
+
const overrides = this.valuesOverrides || {};
|
|
1531
|
+
return new Proxy(overrides, {
|
|
1532
|
+
get(target, prop) {
|
|
1533
|
+
if (typeof prop === "string") {
|
|
1534
|
+
if (prop in target) {
|
|
1535
|
+
return target[prop];
|
|
1536
|
+
} else {
|
|
1537
|
+
return () => {
|
|
1538
|
+
console.error(`Value.${prop} is not defined in test implementation`);
|
|
1539
|
+
return (features, tableRows, confirmCB, initialValues) => {
|
|
1540
|
+
return new class extends BaseValue {
|
|
1541
|
+
constructor(features2, tableRows2, confirmCB2, initialValues2) {
|
|
1542
|
+
super(features2, tableRows2, confirmCB2, initialValues2);
|
|
1543
|
+
}
|
|
1544
|
+
}(
|
|
1545
|
+
features,
|
|
1546
|
+
tableRows,
|
|
1547
|
+
() => {
|
|
1548
|
+
throw new Error(`Value.${prop} is not implemented`);
|
|
1549
|
+
},
|
|
1550
|
+
initialValues
|
|
1551
|
+
);
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
return target[prop];
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1233
1559
|
}
|
|
1234
1560
|
Should() {
|
|
1235
|
-
|
|
1561
|
+
const overrides = this.shouldsOverrides || {};
|
|
1562
|
+
return new Proxy(overrides, {
|
|
1563
|
+
get(target, prop) {
|
|
1564
|
+
if (typeof prop === "string") {
|
|
1565
|
+
if (prop in target) {
|
|
1566
|
+
return target[prop];
|
|
1567
|
+
} else {
|
|
1568
|
+
return (...args) => {
|
|
1569
|
+
console.error(`Should.${prop} is not defined in test implementation`);
|
|
1570
|
+
return new class extends BaseShould {
|
|
1571
|
+
constructor(name, shouldCB) {
|
|
1572
|
+
super(name, shouldCB);
|
|
1573
|
+
}
|
|
1574
|
+
}(`${prop}: ${args && args.toString()}`, () => {
|
|
1575
|
+
throw new Error(`Should.${prop} is not implemented`);
|
|
1576
|
+
});
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
return target[prop];
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1236
1583
|
}
|
|
1237
1584
|
Expect() {
|
|
1238
|
-
|
|
1585
|
+
const overrides = this.expectedsOverrides || {};
|
|
1586
|
+
return new Proxy(overrides, {
|
|
1587
|
+
get(target, prop) {
|
|
1588
|
+
if (typeof prop === "string") {
|
|
1589
|
+
if (prop in target) {
|
|
1590
|
+
return target[prop];
|
|
1591
|
+
} else {
|
|
1592
|
+
return (...args) => {
|
|
1593
|
+
console.error(`Expect.${prop} is not defined in test implementation`);
|
|
1594
|
+
return new class extends BaseExpected {
|
|
1595
|
+
constructor(name, expectedCB) {
|
|
1596
|
+
super(name, expectedCB);
|
|
1597
|
+
}
|
|
1598
|
+
async validateRow(store, testResourceConfiguration, filepath, expectedValue, artifactory) {
|
|
1599
|
+
throw new Error(`Expect.${prop} is not implemented`);
|
|
1600
|
+
}
|
|
1601
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1602
|
+
throw new Error(`Expect.${prop} is not implemented`);
|
|
1603
|
+
});
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
return target[prop];
|
|
1608
|
+
}
|
|
1609
|
+
});
|
|
1239
1610
|
}
|
|
1240
1611
|
Expected() {
|
|
1241
|
-
|
|
1612
|
+
const overrides = this.expectedsOverrides || {};
|
|
1613
|
+
return new Proxy(overrides, {
|
|
1614
|
+
get(target, prop) {
|
|
1615
|
+
if (typeof prop === "string") {
|
|
1616
|
+
if (prop in target) {
|
|
1617
|
+
return target[prop];
|
|
1618
|
+
} else {
|
|
1619
|
+
return (...args) => {
|
|
1620
|
+
console.error(`Expected.${prop} is not defined in test implementation`);
|
|
1621
|
+
return new class extends BaseExpected {
|
|
1622
|
+
constructor(name, expectedCB) {
|
|
1623
|
+
super(name, expectedCB);
|
|
1624
|
+
}
|
|
1625
|
+
async validateRow(store, testResourceConfiguration, filepath, expectedValue, artifactory) {
|
|
1626
|
+
throw new Error(`Expected.${prop} is not implemented`);
|
|
1627
|
+
}
|
|
1628
|
+
}(`${prop}: ${args && args.toString()}`, async () => {
|
|
1629
|
+
throw new Error(`Expected.${prop} is not implemented`);
|
|
1630
|
+
});
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
return target[prop];
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1242
1637
|
}
|
|
1243
1638
|
// Add a method to access test jobs which can be used by receiveTestResourceConfig
|
|
1244
1639
|
getTestJobs() {
|
|
1245
1640
|
return this.testJobs;
|
|
1246
1641
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1642
|
+
createTestJobForStep(step, index, input) {
|
|
1643
|
+
const stepRunner = async (testResourceConfiguration) => {
|
|
1644
|
+
try {
|
|
1645
|
+
let result;
|
|
1646
|
+
const constructorName = step.constructor.name;
|
|
1647
|
+
const stepArtifactory = this.createArtifactory({
|
|
1648
|
+
stepIndex: index,
|
|
1649
|
+
stepType: constructorName.toLowerCase().replace("base", "")
|
|
1650
|
+
});
|
|
1651
|
+
if (constructorName === "BaseGiven") {
|
|
1652
|
+
result = await step.give(
|
|
1653
|
+
input,
|
|
1654
|
+
`step_${index}`,
|
|
1655
|
+
testResourceConfiguration,
|
|
1656
|
+
(t) => !!t,
|
|
1657
|
+
// Simple tester function
|
|
1658
|
+
stepArtifactory,
|
|
1659
|
+
index
|
|
1660
|
+
);
|
|
1661
|
+
} else if (constructorName === "BaseDescribe") {
|
|
1662
|
+
result = await step.describe(
|
|
1663
|
+
input,
|
|
1664
|
+
`step_${index}`,
|
|
1665
|
+
testResourceConfiguration,
|
|
1666
|
+
(t) => !!t,
|
|
1667
|
+
// Simple tester function
|
|
1668
|
+
stepArtifactory,
|
|
1669
|
+
index
|
|
1670
|
+
);
|
|
1671
|
+
} else if (constructorName === "BaseConfirm" || constructorName === "BaseValue") {
|
|
1672
|
+
if (typeof step.run === "function") {
|
|
1673
|
+
result = await step.run(
|
|
1674
|
+
input,
|
|
1675
|
+
testResourceConfiguration,
|
|
1676
|
+
stepArtifactory
|
|
1677
|
+
);
|
|
1678
|
+
} else if (typeof step.confirm === "function") {
|
|
1679
|
+
result = await step.confirm(
|
|
1680
|
+
input,
|
|
1681
|
+
`step_${index}`,
|
|
1682
|
+
testResourceConfiguration,
|
|
1683
|
+
(t) => !!t,
|
|
1684
|
+
// Simple tester function
|
|
1685
|
+
stepArtifactory,
|
|
1686
|
+
index
|
|
1687
|
+
);
|
|
1688
|
+
} else if (typeof step.value === "function") {
|
|
1689
|
+
result = await step.value(
|
|
1690
|
+
input,
|
|
1691
|
+
`step_${index}`,
|
|
1692
|
+
testResourceConfiguration,
|
|
1693
|
+
(t) => !!t,
|
|
1694
|
+
// Simple tester function
|
|
1695
|
+
stepArtifactory,
|
|
1696
|
+
index
|
|
1697
|
+
);
|
|
1698
|
+
}
|
|
1699
|
+
} else {
|
|
1700
|
+
if (typeof step.run === "function") {
|
|
1701
|
+
result = await step.run(
|
|
1702
|
+
input,
|
|
1703
|
+
testResourceConfiguration,
|
|
1704
|
+
stepArtifactory
|
|
1705
|
+
);
|
|
1706
|
+
} else if (typeof step.test === "function") {
|
|
1707
|
+
result = await step.test(
|
|
1708
|
+
input,
|
|
1709
|
+
testResourceConfiguration,
|
|
1710
|
+
stepArtifactory
|
|
1711
|
+
);
|
|
1712
|
+
} else {
|
|
1713
|
+
throw new Error(`Step type ${constructorName} has no runnable method`);
|
|
1255
1714
|
}
|
|
1256
1715
|
}
|
|
1716
|
+
return { step, result, fails: step.fails || 0, failed: step.failed || false };
|
|
1717
|
+
} catch (e) {
|
|
1718
|
+
console.error(e.stack);
|
|
1719
|
+
throw e;
|
|
1257
1720
|
}
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1721
|
+
};
|
|
1722
|
+
const runner = stepRunner;
|
|
1723
|
+
const totalTests = this.totalTests;
|
|
1724
|
+
const testJob = {
|
|
1725
|
+
test: step,
|
|
1726
|
+
toObj: () => {
|
|
1727
|
+
return step.toObj ? step.toObj() : { name: `Step_${index}`, type: step.constructor.name };
|
|
1728
|
+
},
|
|
1729
|
+
runner,
|
|
1730
|
+
receiveTestResourceConfig: async (testResourceConfiguration) => {
|
|
1731
|
+
try {
|
|
1732
|
+
const stepResult = await runner(testResourceConfiguration);
|
|
1733
|
+
const fails = stepResult.fails;
|
|
1734
|
+
const stepObj = stepResult.step;
|
|
1735
|
+
let features = [];
|
|
1736
|
+
if (stepObj.features && Array.isArray(stepObj.features)) {
|
|
1737
|
+
features = stepObj.features;
|
|
1738
|
+
}
|
|
1739
|
+
let artifacts = [];
|
|
1740
|
+
if (stepObj.artifacts && Array.isArray(stepObj.artifacts)) {
|
|
1741
|
+
artifacts = stepObj.artifacts;
|
|
1742
|
+
}
|
|
1743
|
+
let errorDetails = null;
|
|
1744
|
+
if (stepObj.error) {
|
|
1745
|
+
errorDetails = {
|
|
1746
|
+
message: stepObj.error.message,
|
|
1747
|
+
stack: stepObj.error.stack,
|
|
1748
|
+
name: stepObj.error.name
|
|
1749
|
+
};
|
|
1750
|
+
} else if (stepResult.error) {
|
|
1751
|
+
errorDetails = {
|
|
1752
|
+
message: stepResult.error.message,
|
|
1753
|
+
stack: stepResult.error.stack,
|
|
1754
|
+
name: stepResult.error.name
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
return {
|
|
1758
|
+
failed: stepResult.failed || fails > 0,
|
|
1759
|
+
fails,
|
|
1760
|
+
artifacts,
|
|
1761
|
+
features,
|
|
1762
|
+
tests: 1,
|
|
1763
|
+
runTimeTests: totalTests,
|
|
1764
|
+
testJob: testJob.toObj(),
|
|
1765
|
+
error: errorDetails,
|
|
1766
|
+
stepName: stepObj.key || stepObj.name || `Step_${index}`,
|
|
1767
|
+
stepType: stepObj.constructor?.name || "Unknown"
|
|
1768
|
+
};
|
|
1769
|
+
} catch (e) {
|
|
1770
|
+
console.error(e.stack);
|
|
1771
|
+
return {
|
|
1772
|
+
failed: true,
|
|
1773
|
+
fails: -1,
|
|
1774
|
+
artifacts: [],
|
|
1775
|
+
features: [],
|
|
1776
|
+
tests: 0,
|
|
1777
|
+
runTimeTests: -1,
|
|
1778
|
+
testJob: testJob.toObj(),
|
|
1779
|
+
error: {
|
|
1780
|
+
message: e.message,
|
|
1781
|
+
stack: e.stack,
|
|
1782
|
+
name: e.name
|
|
1783
|
+
},
|
|
1784
|
+
stepName: `Step_${index}`,
|
|
1785
|
+
stepType: "Error"
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
return testJob;
|
|
1791
|
+
}
|
|
1792
|
+
createErrorTestJob(errorStep, index, error) {
|
|
1793
|
+
const totalTests = this.totalTests;
|
|
1794
|
+
const uniqueError = new Error(error.message);
|
|
1795
|
+
uniqueError.stack = error.stack;
|
|
1796
|
+
uniqueError.name = error.name;
|
|
1797
|
+
return {
|
|
1798
|
+
test: errorStep,
|
|
1799
|
+
toObj: () => {
|
|
1800
|
+
return errorStep.toObj();
|
|
1801
|
+
},
|
|
1802
|
+
runner: async () => {
|
|
1803
|
+
throw uniqueError;
|
|
1804
|
+
},
|
|
1805
|
+
receiveTestResourceConfig: async (testResourceConfiguration) => {
|
|
1806
|
+
return {
|
|
1807
|
+
failed: true,
|
|
1808
|
+
fails: 1,
|
|
1809
|
+
artifacts: [],
|
|
1810
|
+
features: [],
|
|
1811
|
+
tests: 1,
|
|
1812
|
+
runTimeTests: totalTests,
|
|
1813
|
+
testJob: errorStep.toObj(),
|
|
1814
|
+
error: {
|
|
1815
|
+
message: uniqueError.message,
|
|
1816
|
+
stack: uniqueError.stack,
|
|
1817
|
+
name: uniqueError.name
|
|
1818
|
+
},
|
|
1819
|
+
stepName: errorStep.toObj().name || `ErrorStep_${index}`,
|
|
1820
|
+
stepType: "Error"
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
calculateTotalTestsDirectly() {
|
|
1826
|
+
return this.specs ? this.specs.length : 0;
|
|
1260
1827
|
}
|
|
1261
1828
|
};
|
|
1262
1829
|
|
|
@@ -1264,7 +1831,7 @@ var BaseTiposkripto = class {
|
|
|
1264
1831
|
console.log(`[NodeTiposkripto] ${process.argv}`);
|
|
1265
1832
|
var config = JSON.parse(process.argv[2]);
|
|
1266
1833
|
var NodeTiposkripto = class extends BaseTiposkripto {
|
|
1267
|
-
constructor(input, testSpecification, testImplementation,
|
|
1834
|
+
constructor(input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) {
|
|
1268
1835
|
super(
|
|
1269
1836
|
"node",
|
|
1270
1837
|
input,
|
|
@@ -1291,8 +1858,8 @@ var tiposkripto = async (input, testSpecification, testImplementation, testAdapt
|
|
|
1291
1858
|
input,
|
|
1292
1859
|
testSpecification,
|
|
1293
1860
|
testImplementation,
|
|
1294
|
-
|
|
1295
|
-
|
|
1861
|
+
testAdapter,
|
|
1862
|
+
testResourceRequirement
|
|
1296
1863
|
);
|
|
1297
1864
|
return t;
|
|
1298
1865
|
} catch (e) {
|