testeranto 0.166.0 → 0.167.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.
- package/dist/common/src/Pure.js +2 -2
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
- package/dist/common/src/lib/basebuilder.js +9 -7
- package/dist/common/src/lib/core.test/MockCore.js +17 -15
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Pure.js +2 -2
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
- package/dist/module/src/lib/basebuilder.js +9 -7
- package/dist/module/src/lib/core.test/MockCore.js +17 -15
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/src/lib/index.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Pure.ts +2 -2
- package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +1 -1
- package/src/lib/basebuilder.ts +9 -9
- package/src/lib/core.test/MockCore.ts +26 -19
- package/src/lib/index.ts +1 -1
- package/testeranto/bundles/node/allTests/chunk-H2IBV7SY.mjs +113 -0
- package/testeranto/bundles/node/allTests/chunk-IDCUSTSM.mjs +669 -0
- package/testeranto/bundles/node/allTests/chunk-ZHOULXPN.mjs +252 -0
- package/testeranto/bundles/node/allTests/metafile.json +28 -28
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +3 -3
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +3 -3
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +3 -3
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +11 -8
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +2 -2
- package/testeranto/bundles/pure/allTests/chunk-4ULDTZFU.mjs +666 -0
- package/testeranto/bundles/pure/allTests/chunk-5SBJWHSZ.mjs +200 -0
- package/testeranto/bundles/pure/allTests/metafile.json +33 -33
- package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +2 -2
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +2 -2
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +2 -2
- package/testeranto/bundles/web/allTests/chunk-46E6YGGN.mjs +847 -0
- package/testeranto/bundles/web/allTests/metafile.json +10 -10
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +1 -1
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -0
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -12
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +2 -5
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -0
- package/testeranto/reports/allTests/summary.json +2 -2
- package/tsc.log +236 -234
package/package.json
CHANGED
package/src/Pure.ts
CHANGED
|
@@ -58,7 +58,7 @@ export class PureTesteranto<
|
|
|
58
58
|
failed: true,
|
|
59
59
|
fails: 1,
|
|
60
60
|
artifacts: [],
|
|
61
|
-
logPromise: Promise.resolve(),
|
|
61
|
+
// logPromise: Promise.resolve(),
|
|
62
62
|
features: [],
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -74,7 +74,7 @@ export class PureTesteranto<
|
|
|
74
74
|
failed: true,
|
|
75
75
|
fails: 1,
|
|
76
76
|
artifacts: [],
|
|
77
|
-
logPromise: Promise.resolve(),
|
|
77
|
+
// logPromise: Promise.resolve(),
|
|
78
78
|
features: [],
|
|
79
79
|
};
|
|
80
80
|
}
|
package/src/lib/basebuilder.ts
CHANGED
|
@@ -103,10 +103,10 @@ export abstract class BaseBuilder<
|
|
|
103
103
|
receiveTestResourceConfig: async function (
|
|
104
104
|
puppetMaster: IPM
|
|
105
105
|
): Promise<IFinalResults> {
|
|
106
|
-
const logFilePath = "logs.txt";
|
|
107
|
-
const access: number = await puppetMaster.createWriteStream(
|
|
108
|
-
|
|
109
|
-
);
|
|
106
|
+
// const logFilePath = "logs.txt";
|
|
107
|
+
// const access: number = await puppetMaster.createWriteStream(
|
|
108
|
+
// logFilePath
|
|
109
|
+
// );
|
|
110
110
|
|
|
111
111
|
// deprecated?
|
|
112
112
|
const tLog = async (...l: string[]) => {
|
|
@@ -115,10 +115,10 @@ export abstract class BaseBuilder<
|
|
|
115
115
|
|
|
116
116
|
const suiteDone: BaseSuite<I, O> = await runner(puppetMaster, tLog);
|
|
117
117
|
|
|
118
|
-
const logPromise = new Promise(async (res) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
118
|
+
// const logPromise = new Promise(async (res) => {
|
|
119
|
+
// await puppetMaster.end(access);
|
|
120
|
+
// res(true);
|
|
121
|
+
// });
|
|
122
122
|
|
|
123
123
|
const fails = suiteDone.fails;
|
|
124
124
|
|
|
@@ -133,7 +133,7 @@ export abstract class BaseBuilder<
|
|
|
133
133
|
failed: fails > 0,
|
|
134
134
|
fails,
|
|
135
135
|
artifacts: this.artifacts || [],
|
|
136
|
-
logPromise,
|
|
136
|
+
// logPromise,
|
|
137
137
|
features: suiteDone.features(),
|
|
138
138
|
};
|
|
139
139
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
3
|
import TesterantoCore from "../core";
|
|
2
4
|
|
|
3
5
|
import {
|
|
@@ -31,34 +33,39 @@ export class MockCore<
|
|
|
31
33
|
testAdapter: Partial<ITestAdapter<I>>,
|
|
32
34
|
uberCatcher: (cb: () => void) => void = (cb) => cb()
|
|
33
35
|
) {
|
|
34
|
-
console.log(
|
|
35
|
-
|
|
36
|
+
console.log("[DEBUG] MockCore constructor starting...");
|
|
37
|
+
|
|
36
38
|
if (!testImplementation) {
|
|
37
|
-
throw new Error(
|
|
39
|
+
throw new Error("testImplementation is required");
|
|
38
40
|
}
|
|
39
41
|
if (!testSpecification) {
|
|
40
|
-
console.warn(
|
|
42
|
+
console.warn(
|
|
43
|
+
"[WARN] testSpecification is null/undefined - tests may fail"
|
|
44
|
+
);
|
|
41
45
|
}
|
|
42
|
-
|
|
43
|
-
console.log(
|
|
44
|
-
console.log(
|
|
45
|
-
console.log(
|
|
46
|
-
console.log(
|
|
47
|
-
console.log(
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
|
|
47
|
+
console.log("[DEBUG] MockCore constructor called with:");
|
|
48
|
+
console.log("- input:", JSON.stringify(input, null, 2));
|
|
49
|
+
console.log("- testSpecification keys:", Object.keys(testSpecification));
|
|
50
|
+
console.log("- testImplementation keys:", Object.keys(testImplementation));
|
|
51
|
+
console.log(
|
|
52
|
+
"- testResourceRequirement:",
|
|
53
|
+
JSON.stringify(testResourceRequirement)
|
|
54
|
+
);
|
|
55
|
+
console.log("- testAdapter keys:", Object.keys(testAdapter));
|
|
56
|
+
|
|
50
57
|
// Validate required implementation methods
|
|
51
|
-
const requiredMethods = [
|
|
52
|
-
requiredMethods.forEach(method => {
|
|
58
|
+
const requiredMethods = ["suites", "givens", "whens", "thens"];
|
|
59
|
+
requiredMethods.forEach((method) => {
|
|
53
60
|
if (!testImplementation[method]) {
|
|
54
61
|
throw new Error(`Missing required implementation method: ${method}`);
|
|
55
62
|
}
|
|
56
63
|
});
|
|
57
64
|
|
|
58
|
-
console.log(
|
|
59
|
-
|
|
60
|
-
this.testResourceRequirement = testResourceRequirement;
|
|
61
|
-
this.testAdapter = testAdapter;
|
|
65
|
+
console.log("[DEBUG] Validation passed, calling super...");
|
|
66
|
+
|
|
67
|
+
// this.testResourceRequirement = testResourceRequirement;
|
|
68
|
+
// this.testAdapter = testAdapter;
|
|
62
69
|
super(
|
|
63
70
|
input,
|
|
64
71
|
testSpecification,
|
|
@@ -76,7 +83,7 @@ export class MockCore<
|
|
|
76
83
|
failed: false,
|
|
77
84
|
fails: 0,
|
|
78
85
|
artifacts: [],
|
|
79
|
-
logPromise: Promise.resolve(),
|
|
86
|
+
// logPromise: Promise.resolve(),
|
|
80
87
|
features: [],
|
|
81
88
|
};
|
|
82
89
|
}
|
package/src/lib/index.ts
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
BaseGiven,
|
|
4
|
+
BaseSuite,
|
|
5
|
+
BaseThen,
|
|
6
|
+
BaseWhen
|
|
7
|
+
} from "./chunk-IDCUSTSM.mjs";
|
|
8
|
+
|
|
9
|
+
// src/lib/BaseSuite.test/mock.ts
|
|
10
|
+
var MockGiven = class extends BaseGiven {
|
|
11
|
+
constructor(name, features, whens, thens) {
|
|
12
|
+
super(
|
|
13
|
+
name,
|
|
14
|
+
features,
|
|
15
|
+
whens,
|
|
16
|
+
thens,
|
|
17
|
+
async () => ({ testStore: true, testSelection: false }),
|
|
18
|
+
// givenCB
|
|
19
|
+
{}
|
|
20
|
+
// initialValues
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
async givenThat() {
|
|
24
|
+
return { testStore: true, testSelection: false };
|
|
25
|
+
}
|
|
26
|
+
uberCatcher(e) {
|
|
27
|
+
console.error("Given error 2:", e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var MockWhen = class extends BaseWhen {
|
|
31
|
+
async andWhen(store, whenCB, testResource, pm) {
|
|
32
|
+
console.log(
|
|
33
|
+
"[DEBUG] MockWhen - andWhen - input store:",
|
|
34
|
+
JSON.stringify(store)
|
|
35
|
+
);
|
|
36
|
+
const newStore = {
|
|
37
|
+
...store,
|
|
38
|
+
testSelection: true
|
|
39
|
+
// Ensure testSelection is set for assertions
|
|
40
|
+
};
|
|
41
|
+
console.log("[DEBUG] MockWhen - andWhen - calling whenCB");
|
|
42
|
+
const result = await whenCB(newStore);
|
|
43
|
+
console.log("[DEBUG] MockWhen - andWhen - result:", JSON.stringify(result));
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
addArtifact(name, content) {
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var MockThen = class extends BaseThen {
|
|
51
|
+
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
52
|
+
console.log(
|
|
53
|
+
"[DEBUG] MockThen - butThen - input store:",
|
|
54
|
+
JSON.stringify(store)
|
|
55
|
+
);
|
|
56
|
+
if (!store) {
|
|
57
|
+
throw new Error("Store is undefined in butThen");
|
|
58
|
+
}
|
|
59
|
+
const testSelection = {
|
|
60
|
+
name: store.name,
|
|
61
|
+
index: store.index,
|
|
62
|
+
testSelection: store.testSelection || false,
|
|
63
|
+
error: store.error ? true : void 0
|
|
64
|
+
};
|
|
65
|
+
console.log(
|
|
66
|
+
"[DEBUG] MockThen - passing testSelection:",
|
|
67
|
+
JSON.stringify(testSelection)
|
|
68
|
+
);
|
|
69
|
+
try {
|
|
70
|
+
const result = await thenCB(testSelection);
|
|
71
|
+
console.log(
|
|
72
|
+
"[DEBUG] MockThen - received result:",
|
|
73
|
+
JSON.stringify(result)
|
|
74
|
+
);
|
|
75
|
+
if (!result || typeof result.testSelection === "undefined") {
|
|
76
|
+
throw new Error(
|
|
77
|
+
`Invalid test selection result: ${JSON.stringify(result)}`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
console.error("[ERROR] MockThen - butThen failed:", e);
|
|
83
|
+
throw e;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var MockSuite = class extends BaseSuite {
|
|
88
|
+
constructor(name, index) {
|
|
89
|
+
if (!name) {
|
|
90
|
+
throw new Error("MockSuite requires a non-empty name");
|
|
91
|
+
}
|
|
92
|
+
console.log("[DEBUG] Creating MockSuite with name:", name, "index:", index);
|
|
93
|
+
const suiteName = name || "testSuite";
|
|
94
|
+
super(suiteName, index, {
|
|
95
|
+
testGiven: new MockGiven(
|
|
96
|
+
"testGiven",
|
|
97
|
+
["testFeature"],
|
|
98
|
+
[new MockWhen("testWhen", () => Promise.resolve({ testStore: true }))],
|
|
99
|
+
[
|
|
100
|
+
new MockThen(
|
|
101
|
+
"testThen",
|
|
102
|
+
async () => Promise.resolve({ testSelection: true })
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
)
|
|
106
|
+
});
|
|
107
|
+
console.log("[DEBUG] MockSuite created:", this.name, this.index);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
MockSuite
|
|
113
|
+
};
|