testeranto 0.219.14 → 0.219.15
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/package.json +1 -1
- package/src/testeranto.ts +1 -1
- package/dist/common/allTestsUtils.js +0 -17
- package/dist/common/package.json +0 -3
- package/dist/common/scripts/build-example.js +0 -105
- package/dist/common/src/Init.js +0 -38
- package/dist/common/src/Types.js +0 -63
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +0 -38
- package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -21
- package/dist/common/src/esbuildConfigs/featuresPlugin.js +0 -39
- package/dist/common/src/esbuildConfigs/index.js +0 -22
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -30
- package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -24
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +0 -19
- package/dist/common/src/init-docs.js +0 -9
- package/dist/common/src/lib/tiposkripto/BaseGiven.js +0 -96
- package/dist/common/src/lib/tiposkripto/BaseSuite.js +0 -134
- package/dist/common/src/lib/tiposkripto/BaseThen.js +0 -65
- package/dist/common/src/lib/tiposkripto/BaseTiposkripto.js +0 -193
- package/dist/common/src/lib/tiposkripto/BaseWhen.js +0 -46
- package/dist/common/src/lib/tiposkripto/CoreTypes.js +0 -2
- package/dist/common/src/lib/tiposkripto/Node.js +0 -40
- package/dist/common/src/lib/tiposkripto/Tiposkripto.js +0 -49
- package/dist/common/src/lib/tiposkripto/Types.js +0 -2
- package/dist/common/src/lib/tiposkripto/Web.js +0 -70
- package/dist/common/src/lib/tiposkripto/abstractBase.test/MockGiven.js +0 -22
- package/dist/common/src/lib/tiposkripto/abstractBase.test/MockThen.js +0 -16
- package/dist/common/src/lib/tiposkripto/abstractBase.test/MockWhen.js +0 -18
- package/dist/common/src/lib/tiposkripto/abstractBase.test/adapter.js +0 -24
- package/dist/common/src/lib/tiposkripto/abstractBase.test/implementation.js +0 -38
- package/dist/common/src/lib/tiposkripto/abstractBase.test/index.js +0 -17
- package/dist/common/src/lib/tiposkripto/abstractBase.test/specification.js +0 -19
- package/dist/common/src/lib/tiposkripto/abstractBase.test/types.js +0 -2
- package/dist/common/src/lib/tiposkripto/index.js +0 -29
- package/dist/common/src/runtimes.js +0 -4
- package/dist/common/src/server/aider/configParser.js +0 -124
- package/dist/common/src/server/aider/docker.js +0 -30
- package/dist/common/src/server/getRunnables.js +0 -36
- package/dist/common/src/server/htmlTemplate.js +0 -44
- package/dist/common/src/server/nodeVersion.js +0 -5
- package/dist/common/src/server/runtimes/common.js +0 -136
- package/dist/common/src/server/runtimes/golang/docker.js +0 -62
- package/dist/common/src/server/runtimes/java/docker.js +0 -46
- package/dist/common/src/server/runtimes/node/docker.js +0 -42
- package/dist/common/src/server/runtimes/node/esbuild.js +0 -40
- package/dist/common/src/server/runtimes/node/node.js +0 -75
- package/dist/common/src/server/runtimes/python/docker.js +0 -31
- package/dist/common/src/server/runtimes/ruby/docker.js +0 -34
- package/dist/common/src/server/runtimes/rust/docker.js +0 -35
- package/dist/common/src/server/runtimes/web/docker.js +0 -42
- package/dist/common/src/server/runtimes/web/esbuild.js +0 -29
- package/dist/common/src/server/runtimes/web/hoist.js +0 -16
- package/dist/common/src/server/runtimes/web/web.js +0 -157
- package/dist/common/src/server/serverClasees/Server.js +0 -47
- package/dist/common/src/server/serverClasees/Server_Base.js +0 -18
- package/dist/common/src/server/serverClasees/Server_Docker.js +0 -904
- package/dist/common/src/server/serverClasees/Server_FS.js +0 -119
- package/dist/common/src/server/serverClasees/Server_HTTP.js +0 -189
- package/dist/common/src/server/serverClasees/Server_WS.js +0 -262
- package/dist/common/src/server/serverManagers/DockerManager.js +0 -28
- package/dist/common/src/server/serverManagers/HttpManager.js +0 -114
- package/dist/common/src/server/serverManagers/WsManager.js +0 -230
- package/dist/common/src/server/serverManagers/fs.js +0 -32
- package/dist/common/src/server/serverManagers/tcp.js +0 -51
- package/dist/common/src/server/types.js +0 -2
- package/dist/common/src/testeranto.js +0 -75
- package/dist/common/src/vscode/TerminalManager.js +0 -129
- package/dist/common/src/vscode/TestTreeItem.js +0 -77
- package/dist/common/src/vscode/extension.js +0 -185
- package/dist/common/src/vscode/providers/FeaturesTreeDataProvider.js +0 -445
- package/dist/common/src/vscode/providers/FileTreeDataProvider.js +0 -190
- package/dist/common/src/vscode/providers/ProcessesTreeDataProvider.js +0 -270
- package/dist/common/src/vscode/providers/ResultsTreeDataProvider.js +0 -87
- package/dist/common/src/vscode/providers/TestTreeDataProvider.js +0 -309
- package/dist/common/src/vscode/types.js +0 -9
- package/dist/common/testeranto/runtimes/node/node.js +0 -7
- package/dist/common/testeranto/runtimes/web/web.js +0 -6
- package/dist/common/testeranto/testeranto.js +0 -70
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/module/allTestsUtils.js +0 -13
- package/dist/module/package.json +0 -3
- package/dist/module/scripts/build-example.js +0 -100
- package/dist/module/src/Init.js +0 -33
- package/dist/module/src/Types.js +0 -62
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +0 -32
- package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -18
- package/dist/module/src/esbuildConfigs/featuresPlugin.js +0 -34
- package/dist/module/src/esbuildConfigs/index.js +0 -20
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -25
- package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -21
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +0 -14
- package/dist/module/src/init-docs.js +0 -4
- package/dist/module/src/lib/tiposkripto/BaseGiven.js +0 -92
- package/dist/module/src/lib/tiposkripto/BaseSuite.js +0 -130
- package/dist/module/src/lib/tiposkripto/BaseThen.js +0 -61
- package/dist/module/src/lib/tiposkripto/BaseTiposkripto.js +0 -190
- package/dist/module/src/lib/tiposkripto/BaseWhen.js +0 -42
- package/dist/module/src/lib/tiposkripto/CoreTypes.js +0 -1
- package/dist/module/src/lib/tiposkripto/Node.js +0 -33
- package/dist/module/src/lib/tiposkripto/Tiposkripto.js +0 -14
- package/dist/module/src/lib/tiposkripto/Types.js +0 -1
- package/dist/module/src/lib/tiposkripto/Web.js +0 -63
- package/dist/module/src/lib/tiposkripto/abstractBase.test/MockGiven.js +0 -18
- package/dist/module/src/lib/tiposkripto/abstractBase.test/MockThen.js +0 -12
- package/dist/module/src/lib/tiposkripto/abstractBase.test/MockWhen.js +0 -14
- package/dist/module/src/lib/tiposkripto/abstractBase.test/adapter.js +0 -21
- package/dist/module/src/lib/tiposkripto/abstractBase.test/implementation.js +0 -35
- package/dist/module/src/lib/tiposkripto/abstractBase.test/index.js +0 -12
- package/dist/module/src/lib/tiposkripto/abstractBase.test/specification.js +0 -15
- package/dist/module/src/lib/tiposkripto/abstractBase.test/types.js +0 -1
- package/dist/module/src/lib/tiposkripto/index.js +0 -24
- package/dist/module/src/runtimes.js +0 -1
- package/dist/module/src/server/aider/configParser.js +0 -116
- package/dist/module/src/server/aider/docker.js +0 -28
- package/dist/module/src/server/getRunnables.js +0 -29
- package/dist/module/src/server/htmlTemplate.js +0 -40
- package/dist/module/src/server/nodeVersion.js +0 -2
- package/dist/module/src/server/runtimes/common.js +0 -127
- package/dist/module/src/server/runtimes/golang/docker.js +0 -55
- package/dist/module/src/server/runtimes/java/docker.js +0 -40
- package/dist/module/src/server/runtimes/node/docker.js +0 -36
- package/dist/module/src/server/runtimes/node/esbuild.js +0 -35
- package/dist/module/src/server/runtimes/node/node.js +0 -37
- package/dist/module/src/server/runtimes/python/docker.js +0 -25
- package/dist/module/src/server/runtimes/ruby/docker.js +0 -28
- package/dist/module/src/server/runtimes/rust/docker.js +0 -29
- package/dist/module/src/server/runtimes/web/docker.js +0 -36
- package/dist/module/src/server/runtimes/web/esbuild.js +0 -24
- package/dist/module/src/server/runtimes/web/hoist.js +0 -11
- package/dist/module/src/server/runtimes/web/web.js +0 -119
- package/dist/module/src/server/serverClasees/Server.js +0 -40
- package/dist/module/src/server/serverClasees/Server_Base.js +0 -14
- package/dist/module/src/server/serverClasees/Server_Docker.js +0 -897
- package/dist/module/src/server/serverClasees/Server_FS.js +0 -119
- package/dist/module/src/server/serverClasees/Server_HTTP.js +0 -182
- package/dist/module/src/server/serverClasees/Server_WS.js +0 -258
- package/dist/module/src/server/serverManagers/DockerManager.js +0 -28
- package/dist/module/src/server/serverManagers/HttpManager.js +0 -110
- package/dist/module/src/server/serverManagers/WsManager.js +0 -226
- package/dist/module/src/server/serverManagers/fs.js +0 -32
- package/dist/module/src/server/serverManagers/tcp.js +0 -47
- package/dist/module/src/server/types.js +0 -1
- package/dist/module/src/testeranto.js +0 -40
- package/dist/module/src/vscode/TerminalManager.js +0 -92
- package/dist/module/src/vscode/TestTreeItem.js +0 -40
- package/dist/module/src/vscode/extension.js +0 -148
- package/dist/module/src/vscode/providers/FeaturesTreeDataProvider.js +0 -408
- package/dist/module/src/vscode/providers/FileTreeDataProvider.js +0 -153
- package/dist/module/src/vscode/providers/ProcessesTreeDataProvider.js +0 -233
- package/dist/module/src/vscode/providers/ResultsTreeDataProvider.js +0 -50
- package/dist/module/src/vscode/providers/TestTreeDataProvider.js +0 -272
- package/dist/module/src/vscode/types.js +0 -6
- package/dist/module/testeranto/runtimes/node/node.js +0 -5
- package/dist/module/testeranto/runtimes/web/web.js +0 -4
- package/dist/module/testeranto/testeranto.js +0 -68
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/prebuild/chunk-QLT7PNPK.mjs +0 -162
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -20
- package/dist/prebuild/init-docs.mjs +0 -56
- package/dist/prebuild/server/runtimes/node/node.mjs +0 -80
- package/dist/prebuild/server/runtimes/web/hoist.mjs +0 -12
- package/dist/prebuild/server/runtimes/web/web.mjs +0 -162
- package/dist/prebuild/testeranto-6SAYRVSE.mjs +0 -72
- package/dist/prebuild/testeranto.mjs +0 -1692
- package/dist/types/src/Init.d.ts +0 -2
- package/dist/types/src/Types.d.ts +0 -87
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/featuresPlugin.d.ts +0 -5
- package/dist/types/src/esbuildConfigs/index.d.ts +0 -3
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +0 -7
- package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +0 -6
- package/dist/types/src/init-docs.d.ts +0 -1
- package/dist/types/src/lib/tiposkripto/BaseGiven.d.ts +0 -42
- package/dist/types/src/lib/tiposkripto/BaseSuite.d.ts +0 -46
- package/dist/types/src/lib/tiposkripto/BaseThen.d.ts +0 -28
- package/dist/types/src/lib/tiposkripto/BaseTiposkripto.d.ts +0 -35
- package/dist/types/src/lib/tiposkripto/BaseWhen.d.ts +0 -27
- package/dist/types/src/lib/tiposkripto/CoreTypes.d.ts +0 -51
- package/dist/types/src/lib/tiposkripto/Node.d.ts +0 -9
- package/dist/types/src/lib/tiposkripto/Tiposkripto.d.ts +0 -5
- package/dist/types/src/lib/tiposkripto/Types.d.ts +0 -9
- package/dist/types/src/lib/tiposkripto/Web.d.ts +0 -9
- package/dist/types/src/lib/tiposkripto/abstractBase.test/MockGiven.d.ts +0 -9
- package/dist/types/src/lib/tiposkripto/abstractBase.test/MockThen.d.ts +0 -6
- package/dist/types/src/lib/tiposkripto/abstractBase.test/MockWhen.d.ts +0 -6
- package/dist/types/src/lib/tiposkripto/abstractBase.test/adapter.d.ts +0 -3
- package/dist/types/src/lib/tiposkripto/abstractBase.test/implementation.d.ts +0 -3
- package/dist/types/src/lib/tiposkripto/abstractBase.test/index.d.ts +0 -28
- package/dist/types/src/lib/tiposkripto/abstractBase.test/specification.d.ts +0 -3
- package/dist/types/src/lib/tiposkripto/abstractBase.test/types.d.ts +0 -39
- package/dist/types/src/lib/tiposkripto/index.d.ts +0 -56
- package/dist/types/src/runtimes.d.ts +0 -2
- package/dist/types/src/server/aider/configParser.d.ts +0 -11
- package/dist/types/src/server/aider/docker.d.ts +0 -2
- package/dist/types/src/server/getRunnables.d.ts +0 -3
- package/dist/types/src/server/htmlTemplate.d.ts +0 -2
- package/dist/types/src/server/nodeVersion.d.ts +0 -2
- package/dist/types/src/server/runtimes/common.d.ts +0 -12
- package/dist/types/src/server/runtimes/golang/docker.d.ts +0 -5
- package/dist/types/src/server/runtimes/java/docker.d.ts +0 -14
- package/dist/types/src/server/runtimes/node/docker.d.ts +0 -14
- package/dist/types/src/server/runtimes/node/esbuild.d.ts +0 -4
- package/dist/types/src/server/runtimes/node/node.d.ts +0 -1
- package/dist/types/src/server/runtimes/python/docker.d.ts +0 -14
- package/dist/types/src/server/runtimes/ruby/docker.d.ts +0 -14
- package/dist/types/src/server/runtimes/rust/docker.d.ts +0 -14
- package/dist/types/src/server/runtimes/web/docker.d.ts +0 -15
- package/dist/types/src/server/runtimes/web/esbuild.d.ts +0 -4
- package/dist/types/src/server/runtimes/web/hoist.d.ts +0 -1
- package/dist/types/src/server/runtimes/web/web.d.ts +0 -1
- package/dist/types/src/server/serverClasees/Server.d.ts +0 -8
- package/dist/types/src/server/serverClasees/Server_Base.d.ts +0 -9
- package/dist/types/src/server/serverClasees/Server_Docker.d.ts +0 -81
- package/dist/types/src/server/serverClasees/Server_FS.d.ts +0 -0
- package/dist/types/src/server/serverClasees/Server_HTTP.d.ts +0 -20
- package/dist/types/src/server/serverClasees/Server_WS.d.ts +0 -23
- package/dist/types/src/server/serverManagers/DockerManager.d.ts +0 -0
- package/dist/types/src/server/serverManagers/HttpManager.d.ts +0 -9
- package/dist/types/src/server/serverManagers/WsManager.d.ts +0 -10
- package/dist/types/src/server/serverManagers/fs.d.ts +0 -0
- package/dist/types/src/server/serverManagers/tcp.d.ts +0 -27
- package/dist/types/src/server/types.d.ts +0 -68
- package/dist/types/src/testeranto.d.ts +0 -1
- package/dist/types/src/vscode/TerminalManager.d.ts +0 -18
- package/dist/types/src/vscode/TestTreeItem.d.ts +0 -13
- package/dist/types/src/vscode/extension.d.ts +0 -3
- package/dist/types/src/vscode/providers/FeaturesTreeDataProvider.d.ts +0 -17
- package/dist/types/src/vscode/providers/FileTreeDataProvider.d.ts +0 -13
- package/dist/types/src/vscode/providers/ProcessesTreeDataProvider.d.ts +0 -23
- package/dist/types/src/vscode/providers/ResultsTreeDataProvider.d.ts +0 -10
- package/dist/types/src/vscode/providers/TestTreeDataProvider.d.ts +0 -16
- package/dist/types/src/vscode/types.d.ts +0 -14
- package/dist/types/testeranto/testeranto.d.ts +0 -3
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/dist/vscode/extension.mjs +0 -5116
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export class BaseWhen {
|
|
2
|
-
addArtifact(path) {
|
|
3
|
-
if (typeof path !== "string") {
|
|
4
|
-
throw new Error(`[ARTIFACT ERROR] Expected string, got ${typeof path}: ${JSON.stringify(path)}`);
|
|
5
|
-
}
|
|
6
|
-
const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
|
|
7
|
-
this.artifacts.push(normalizedPath);
|
|
8
|
-
}
|
|
9
|
-
constructor(name, whenCB) {
|
|
10
|
-
this.artifacts = [];
|
|
11
|
-
this.name = name;
|
|
12
|
-
this.whenCB = whenCB;
|
|
13
|
-
}
|
|
14
|
-
toObj() {
|
|
15
|
-
const obj = {
|
|
16
|
-
name: this.name,
|
|
17
|
-
status: this.status,
|
|
18
|
-
error: this.error
|
|
19
|
-
? `${this.error.name}: ${this.error.message}\n${this.error.stack}`
|
|
20
|
-
: null,
|
|
21
|
-
artifacts: this.artifacts,
|
|
22
|
-
};
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
async test(store, testResourceConfiguration) {
|
|
26
|
-
try {
|
|
27
|
-
// Ensure addArtifact is properly bound to 'this'
|
|
28
|
-
// const addArtifact = this.addArtifact.bind(this);
|
|
29
|
-
// const proxiedPm = andWhenProxy(pm, filepath, addArtifact);
|
|
30
|
-
const result = await this.andWhen(store, this.whenCB, testResourceConfiguration
|
|
31
|
-
// proxiedPm
|
|
32
|
-
);
|
|
33
|
-
this.status = true;
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
this.status = false;
|
|
38
|
-
this.error = e;
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import Tiposkripto from "./BaseTiposkripto.js";
|
|
3
|
-
import { defaultTestResourceRequirement, } from "./index.js";
|
|
4
|
-
console.log(`[NodeTiposkripto] ${process.argv}`);
|
|
5
|
-
const config = { ports: [1111], fs: 'testeranto/reports/allTests/example/Calculator.test/node' };
|
|
6
|
-
export class NodeTiposkripto extends Tiposkripto {
|
|
7
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
|
|
8
|
-
// console.log(`[NodeTiposkripto] constructor ${process.argv[3]}`);
|
|
9
|
-
// const config = JSON.parse(process.argv[3])
|
|
10
|
-
super("node", input, testSpecification, testImplementation, testResourceRequirement, testAdapter, config);
|
|
11
|
-
}
|
|
12
|
-
writeFileSync(filename, payload) {
|
|
13
|
-
console.log('writeFileSync', filename);
|
|
14
|
-
const dir = "testeranto/reports/allTests/example";
|
|
15
|
-
if (!fs.existsSync(dir)) {
|
|
16
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
17
|
-
}
|
|
18
|
-
// Write to the exact filename provided
|
|
19
|
-
fs.writeFileSync(filename, payload);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const tiposkripto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
23
|
-
try {
|
|
24
|
-
const t = new NodeTiposkripto(input, testSpecification, testImplementation, testResourceRequirement, testAdapter);
|
|
25
|
-
return t;
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
console.error(`[Node] Error creating Tiposkripto:`, e);
|
|
29
|
-
console.error(e.stack);
|
|
30
|
-
process.exit(-1);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export default tiposkripto;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defaultTestResourceRequirement } from ".";
|
|
2
|
-
let tpskrt;
|
|
3
|
-
if (ENV === "node") {
|
|
4
|
-
tpskrt = await import("./Node");
|
|
5
|
-
}
|
|
6
|
-
else if (ENV === "web") {
|
|
7
|
-
tpskrt = await import("./Web");
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
throw `Unknown ENV ${ENV}`;
|
|
11
|
-
}
|
|
12
|
-
export default async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement, testResourceConfiguration) => {
|
|
13
|
-
return (await tpskrt.default)(input, testSpecification, testImplementation, testResourceRequirement, testAdapter, testResourceConfiguration);
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import Tiposkripto from "./BaseTiposkripto.js";
|
|
2
|
-
import { defaultTestResourceRequirement, } from "./index.js";
|
|
3
|
-
const config = {
|
|
4
|
-
name: 'web',
|
|
5
|
-
fs: 'testeranto/reports/allTests/example/Calculator.test/web',
|
|
6
|
-
ports: [1111],
|
|
7
|
-
files: [],
|
|
8
|
-
timeout: 30000,
|
|
9
|
-
retries: 3,
|
|
10
|
-
environment: {}
|
|
11
|
-
};
|
|
12
|
-
export class WebTiposkripto extends Tiposkripto {
|
|
13
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
|
|
14
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
15
|
-
const encodedConfig = urlParams.get("config");
|
|
16
|
-
const testResourceConfig = encodedConfig
|
|
17
|
-
? decodeURIComponent(encodedConfig)
|
|
18
|
-
: "{}";
|
|
19
|
-
super("web", input, testSpecification, testImplementation, testResourceRequirement, testAdapter,
|
|
20
|
-
// JSON.parse(testResourceConfig)
|
|
21
|
-
config);
|
|
22
|
-
}
|
|
23
|
-
writeFileSync(filename, payload) {
|
|
24
|
-
// Store files in a global object that can be accessed via Puppeteer
|
|
25
|
-
if (!window.__testeranto_files__) {
|
|
26
|
-
window.__testeranto_files__ = {};
|
|
27
|
-
}
|
|
28
|
-
window.__testeranto_files__[filename] = payload;
|
|
29
|
-
// Also try to use the File System Access API if available
|
|
30
|
-
if (navigator.storage && navigator.storage.getDirectory) {
|
|
31
|
-
(async () => {
|
|
32
|
-
try {
|
|
33
|
-
const root = await navigator.storage.getDirectory();
|
|
34
|
-
const fileHandle = await root.getFileHandle(filename, { create: true });
|
|
35
|
-
const writable = await fileHandle.createWritable();
|
|
36
|
-
await writable.write(payload);
|
|
37
|
-
await writable.close();
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
console.warn('Could not write to browser storage:', e);
|
|
41
|
-
}
|
|
42
|
-
})();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const tiposkripto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
47
|
-
try {
|
|
48
|
-
const t = new WebTiposkripto(input, testSpecification, testImplementation, testResourceRequirement, testAdapter);
|
|
49
|
-
// const data = navigator.storage.
|
|
50
|
-
const root = await navigator.storage.getDirectory();
|
|
51
|
-
// 1. Create (or get) a file handle
|
|
52
|
-
const fileHandle = await root.getFileHandle(`${config.fs}/tests.json`);
|
|
53
|
-
return t;
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
console.error(e);
|
|
57
|
-
// Dispatch an error event
|
|
58
|
-
const errorEvent = new CustomEvent("test-error", { detail: e });
|
|
59
|
-
window.dispatchEvent(errorEvent);
|
|
60
|
-
throw e;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
export default tiposkripto;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BaseGiven } from "../BaseGiven";
|
|
2
|
-
export class MockGiven extends BaseGiven {
|
|
3
|
-
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
4
|
-
super(name, features, whens, thens, givenCB, initialValues);
|
|
5
|
-
}
|
|
6
|
-
async givenThat(subject, testResourceConfiguration, artifactory, givenCB, initialValues) {
|
|
7
|
-
// Call the givenCB which is a function that returns the store
|
|
8
|
-
const result = givenCB();
|
|
9
|
-
if (typeof result === "function") {
|
|
10
|
-
return result();
|
|
11
|
-
}
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
uberCatcher(e) {
|
|
15
|
-
console.error("MockGiven error:", e);
|
|
16
|
-
this.error = e;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseThen } from "../BaseThen";
|
|
2
|
-
export class MockThen extends BaseThen {
|
|
3
|
-
constructor(name, thenCB) {
|
|
4
|
-
super(name, thenCB);
|
|
5
|
-
}
|
|
6
|
-
async butThen(store, thenCB, testResourceConfiguration) {
|
|
7
|
-
// The thenCB expects a selection, not the store directly
|
|
8
|
-
// We need to extract the selection from the store
|
|
9
|
-
const selection = { testSelection: store.testSelection };
|
|
10
|
-
return thenCB(selection);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseWhen } from "../BaseWhen";
|
|
2
|
-
export class MockWhen extends BaseWhen {
|
|
3
|
-
constructor(name, whenCB) {
|
|
4
|
-
super(name, whenCB);
|
|
5
|
-
}
|
|
6
|
-
async andWhen(store, whenCB, testResource) {
|
|
7
|
-
// The whenCB returns a function that takes the store
|
|
8
|
-
const result = whenCB(store);
|
|
9
|
-
if (typeof result === "function") {
|
|
10
|
-
return result(store);
|
|
11
|
-
}
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const testAdapter = {
|
|
2
|
-
beforeEach: async (subject, initializer, testResource, initialValues) => {
|
|
3
|
-
const result = await initializer();
|
|
4
|
-
// Ensure the result matches the expected type
|
|
5
|
-
if (typeof result === "function") {
|
|
6
|
-
// If it's a function, call it to get the actual store
|
|
7
|
-
return result();
|
|
8
|
-
}
|
|
9
|
-
return result;
|
|
10
|
-
},
|
|
11
|
-
andWhen: async (store, whenCB, testResource, pm) => {
|
|
12
|
-
return whenCB(store);
|
|
13
|
-
},
|
|
14
|
-
butThen: async (store, thenCB, testResource, pm) => {
|
|
15
|
-
return thenCB(store);
|
|
16
|
-
},
|
|
17
|
-
afterEach: async (store, key, pm) => Promise.resolve(store),
|
|
18
|
-
afterAll: async (store, pm) => { },
|
|
19
|
-
assertThis: (result) => !!result,
|
|
20
|
-
beforeAll: async (input, testResource, pm) => input,
|
|
21
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const implementation = {
|
|
2
|
-
suites: {
|
|
3
|
-
Default: "Abstract Base Test Suite",
|
|
4
|
-
},
|
|
5
|
-
givens: {
|
|
6
|
-
Default: () => () => ({
|
|
7
|
-
testStore: { value: "initial" },
|
|
8
|
-
testSelection: { selected: true },
|
|
9
|
-
}),
|
|
10
|
-
WithError: () => () => ({
|
|
11
|
-
testStore: { value: "error" },
|
|
12
|
-
testSelection: { selected: false },
|
|
13
|
-
}),
|
|
14
|
-
},
|
|
15
|
-
whens: {
|
|
16
|
-
modifyStore: (newValue) => (store) => (Object.assign(Object.assign({}, store), { testStore: { value: newValue } })),
|
|
17
|
-
throwError: () => (store) => {
|
|
18
|
-
throw new Error("Test error");
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
thens: {
|
|
22
|
-
verifyStore: (expected) => (store) => {
|
|
23
|
-
if (store.testStore.value !== expected) {
|
|
24
|
-
throw new Error(`Expected ${expected}, got ${store.testStore.value}`);
|
|
25
|
-
}
|
|
26
|
-
return store;
|
|
27
|
-
},
|
|
28
|
-
verifyError: (expected) => (store) => {
|
|
29
|
-
if (!store.error || !store.error.message.includes(expected)) {
|
|
30
|
-
throw new Error(`Expected error "${expected}" not found`);
|
|
31
|
-
}
|
|
32
|
-
return store;
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Tiposkripto from "../Tiposkripto";
|
|
2
|
-
import { testAdapter } from "./adapter";
|
|
3
|
-
import { implementation } from "./implementation";
|
|
4
|
-
import { MockGiven } from "./MockGiven";
|
|
5
|
-
import { MockThen } from "./MockThen";
|
|
6
|
-
import { MockWhen } from "./MockWhen";
|
|
7
|
-
import { specification } from "./specification";
|
|
8
|
-
export default Tiposkripto({
|
|
9
|
-
MockGiven,
|
|
10
|
-
MockWhen,
|
|
11
|
-
MockThen,
|
|
12
|
-
}, specification, implementation, testAdapter);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const specification = (Suite, Given, When, Then) => [
|
|
2
|
-
Suite.Default("BaseGiven Tests", {
|
|
3
|
-
initialization: Given.Default(["Should initialize with default values"], [], [Then.verifyStore("initial")]),
|
|
4
|
-
errorHandling: Given.WithError(["Should handle errors properly"], [When.throwError()], [Then.verifyError("Test error")]),
|
|
5
|
-
}),
|
|
6
|
-
Suite.Default("BaseWhen Tests", {
|
|
7
|
-
stateModification: Given.Default(["Should modify state correctly"], [When.modifyStore("modified")], [Then.verifyStore("modified")]),
|
|
8
|
-
errorPropagation: Given.Default(["Should propagate errors"], [When.throwError()], [Then.verifyError("Test error")]),
|
|
9
|
-
}),
|
|
10
|
-
Suite.Default("BaseThen Tests", {
|
|
11
|
-
assertionPassing: Given.Default(["Should pass valid assertions"], [When.modifyStore("asserted")], [Then.verifyStore("asserted")]),
|
|
12
|
-
assertionFailing: Given.Default(["Should fail invalid assertions"], [When.modifyStore("wrong")], [Then.verifyStore("right")] // This should fail
|
|
13
|
-
),
|
|
14
|
-
}),
|
|
15
|
-
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const BaseAdapter = () => ({
|
|
2
|
-
beforeAll: async (input, testResource) => {
|
|
3
|
-
return input;
|
|
4
|
-
},
|
|
5
|
-
beforeEach: async function (subject, initializer, testResource, initialValues) {
|
|
6
|
-
return subject;
|
|
7
|
-
},
|
|
8
|
-
afterEach: async (store, key) => Promise.resolve(store),
|
|
9
|
-
afterAll: (store) => undefined,
|
|
10
|
-
butThen: async (store, thenCb, testResource) => {
|
|
11
|
-
return thenCb(store);
|
|
12
|
-
},
|
|
13
|
-
andWhen: async (store, whenCB, testResource) => {
|
|
14
|
-
return whenCB(store);
|
|
15
|
-
},
|
|
16
|
-
assertThis: (x) => x,
|
|
17
|
-
});
|
|
18
|
-
export const DefaultAdapter = (p) => {
|
|
19
|
-
const base = BaseAdapter();
|
|
20
|
-
return Object.assign(Object.assign({}, base), p);
|
|
21
|
-
};
|
|
22
|
-
export const defaultTestResourceRequirement = {
|
|
23
|
-
ports: 0,
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const RUN_TIMES = ["node", "web", "python", "golang", "java", "rust", "ruby"];
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import yaml from "js-yaml";
|
|
4
|
-
export function parseAiderConfig() {
|
|
5
|
-
console.log("parseAiderConfig: Looking for .aider.conf.yml");
|
|
6
|
-
const configPath = path.join(process.cwd(), ".aider.conf.yml");
|
|
7
|
-
if (!fs.existsSync(configPath)) {
|
|
8
|
-
console.log(`No .aider.conf.yml file found at ${configPath}`);
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
console.log(`Found .aider.conf.yml at ${configPath}`);
|
|
13
|
-
const fileContent = fs.readFileSync(configPath, "utf8");
|
|
14
|
-
// Clean the content - remove any problematic characters
|
|
15
|
-
const cleanedContent = fileContent
|
|
16
|
-
.replace(/\r\n/g, "\n") // Normalize line endings
|
|
17
|
-
.replace(/\t/g, " ") // Convert tabs to spaces
|
|
18
|
-
.replace(/[^\x20-\x7E\n\r]/g, "") // Remove non-printable characters except newlines
|
|
19
|
-
.trim();
|
|
20
|
-
// Try to parse with safe load
|
|
21
|
-
const config = yaml.load(cleanedContent, { json: true });
|
|
22
|
-
if (!config) {
|
|
23
|
-
console.log("Config file is empty or contains only comments");
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
return config;
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error(`Failed to parse .aider.conf.yml:`, error.message);
|
|
30
|
-
// Try to read the file again and log each line
|
|
31
|
-
try {
|
|
32
|
-
const lines = fs.readFileSync(configPath, "utf8").split("\n");
|
|
33
|
-
console.error("File contents (line by line):");
|
|
34
|
-
lines.forEach((line, index) => {
|
|
35
|
-
console.error(`Line ${index + 1}: "${line}"`);
|
|
36
|
-
// Check for problematic characters
|
|
37
|
-
const hasInvalidChars = /[^\x20-\x7E]/.test(line);
|
|
38
|
-
if (hasInvalidChars) {
|
|
39
|
-
console.error(` WARNING: Line ${index + 1} contains non-printable characters`);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
catch (readError) {
|
|
44
|
-
console.error("Could not read file for line-by-line analysis:", readError);
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export function extractApiKeys(config) {
|
|
50
|
-
// console.log("extractApiKeys");
|
|
51
|
-
const apiKeys = {};
|
|
52
|
-
if (!config) {
|
|
53
|
-
console.log("No config provided to extractApiKeys");
|
|
54
|
-
return apiKeys;
|
|
55
|
-
}
|
|
56
|
-
// Handle single api-key string
|
|
57
|
-
if (typeof config["api-key"] === "string") {
|
|
58
|
-
// console.log(`Found single api-key string: ${config["api-key"]}`);
|
|
59
|
-
const [provider, key] = config["api-key"].split("=");
|
|
60
|
-
if (provider && key) {
|
|
61
|
-
apiKeys[provider.trim()] = key.trim();
|
|
62
|
-
// console.log(`Extracted API key for provider: ${provider.trim()}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Handle array of api-key strings
|
|
66
|
-
else if (Array.isArray(config["api-key"])) {
|
|
67
|
-
console.log(`Found api-key array with ${config["api-key"].length} entries`);
|
|
68
|
-
config["api-key"].forEach((keyEntry, index) => {
|
|
69
|
-
// console.log(`Processing api-key entry ${index + 1}: ${keyEntry}`);
|
|
70
|
-
const [provider, key] = keyEntry.split("=");
|
|
71
|
-
if (provider && key) {
|
|
72
|
-
apiKeys[provider.trim()] = key.trim();
|
|
73
|
-
// console.log(`Extracted API key for provider: ${provider.trim()}`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
console.log(`Could not parse api-key entry: ${keyEntry}`);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else if (config["api-key"]) {
|
|
81
|
-
console.log(`api-key has unexpected type: ${typeof config["api-key"]}, value: ${config["api-key"]}`);
|
|
82
|
-
}
|
|
83
|
-
// Handle individual API keys
|
|
84
|
-
if (config["openai-api-key"]) {
|
|
85
|
-
apiKeys["openai"] = config["openai-api-key"];
|
|
86
|
-
// console.log(`Extracted OpenAI API key`);
|
|
87
|
-
}
|
|
88
|
-
if (config["anthropic-api-key"]) {
|
|
89
|
-
apiKeys["anthropic"] = config["anthropic-api-key"];
|
|
90
|
-
// console.log(`Extracted Anthropic API key`);
|
|
91
|
-
}
|
|
92
|
-
console.log(`Extracted API keys for providers: ${Object.keys(apiKeys).join(", ")}`);
|
|
93
|
-
return apiKeys;
|
|
94
|
-
}
|
|
95
|
-
export function getApiKeyEnvironmentVariables(config) {
|
|
96
|
-
const apiKeys = extractApiKeys(config);
|
|
97
|
-
const envVars = {};
|
|
98
|
-
// Map provider names to environment variable names
|
|
99
|
-
const providerToEnvVar = {
|
|
100
|
-
openai: "OPENAI_API_KEY",
|
|
101
|
-
anthropic: "ANTHROPIC_API_KEY",
|
|
102
|
-
deepseek: "DEEPSEEK_API_KEY",
|
|
103
|
-
google: "GOOGLE_API_KEY",
|
|
104
|
-
groq: "GROQ_API_KEY",
|
|
105
|
-
mistral: "MISTRAL_API_KEY",
|
|
106
|
-
cohere: "COHERE_API_KEY",
|
|
107
|
-
together: "TOGETHER_API_KEY",
|
|
108
|
-
};
|
|
109
|
-
for (const [provider, key] of Object.entries(apiKeys)) {
|
|
110
|
-
const envVarName = providerToEnvVar[provider.toLowerCase()] ||
|
|
111
|
-
`${provider.toUpperCase()}_API_KEY`;
|
|
112
|
-
envVars[envVarName] = key;
|
|
113
|
-
console.log(`Setting environment variable ${envVarName} for provider ${provider}`);
|
|
114
|
-
}
|
|
115
|
-
return envVars;
|
|
116
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { parseAiderConfig, getApiKeyEnvironmentVariables, } from "./configParser";
|
|
2
|
-
// Add this helper function at the top of the file
|
|
3
|
-
function loadAiderApiKeys() {
|
|
4
|
-
try {
|
|
5
|
-
console.log("Attempting to load API keys from .aider.conf.yml...");
|
|
6
|
-
const config = parseAiderConfig();
|
|
7
|
-
if (config) {
|
|
8
|
-
const envVars = getApiKeyEnvironmentVariables(config);
|
|
9
|
-
if (Object.keys(envVars).length > 0) {
|
|
10
|
-
console.log("Successfully loaded API keys from .aider.conf.yml");
|
|
11
|
-
return envVars;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
console.log("No API keys found in .aider.conf.yml");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
console.log("Could not parse .aider.conf.yml or file not found");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
console.error("Failed to load API keys from .aider.conf.yml:", error);
|
|
23
|
-
}
|
|
24
|
-
return {};
|
|
25
|
-
}
|
|
26
|
-
// This file is no longer needed as we're not using a separate aider-pool container
|
|
27
|
-
// Each test will start its own aider process directly
|
|
28
|
-
export default {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
export const getRunnables = (config, projectName) => {
|
|
3
|
-
return {
|
|
4
|
-
golangEntryPoints: Object.entries(config.golang.tests).reduce((pt, cv) => {
|
|
5
|
-
pt[cv[0]] = path.resolve(cv[0]);
|
|
6
|
-
return pt;
|
|
7
|
-
}, {}),
|
|
8
|
-
nodeEntryPoints: Object.entries(config.node.tests).reduce((pt, cv) => {
|
|
9
|
-
pt[cv[0]] = path.resolve(`./testeranto/bundles/${projectName}/node/${cv[0]
|
|
10
|
-
.split(".")
|
|
11
|
-
.slice(0, -1)
|
|
12
|
-
.concat("mjs")
|
|
13
|
-
.join(".")}`);
|
|
14
|
-
return pt;
|
|
15
|
-
}, {}),
|
|
16
|
-
pythonEntryPoints: Object.entries(config.python.tests).reduce((pt, cv) => {
|
|
17
|
-
pt[cv[0]] = path.resolve(cv[0]);
|
|
18
|
-
return pt;
|
|
19
|
-
}, {}),
|
|
20
|
-
webEntryPoints: Object.entries(config.web.tests).reduce((pt, cv) => {
|
|
21
|
-
pt[cv[0]] = path.resolve(`./testeranto/bundles/${projectName}/web/${cv[0]
|
|
22
|
-
.split(".")
|
|
23
|
-
.slice(0, -1)
|
|
24
|
-
.concat("mjs")
|
|
25
|
-
.join(".")}`);
|
|
26
|
-
return pt;
|
|
27
|
-
}, {}),
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Utility function to generate HTML for React apps
|
|
2
|
-
export function generateReactAppHtml(title, scriptPath, appName) {
|
|
3
|
-
return `
|
|
4
|
-
<!DOCTYPE html>
|
|
5
|
-
<html lang="en">
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset="UTF-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
<title>${title}</title>
|
|
10
|
-
<link href="/dist/prebuild/style.css" rel="stylesheet">
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<div id="root"></div>
|
|
14
|
-
<script src="/dist/prebuild/server/serverClasees/${scriptPath}.js"></script>
|
|
15
|
-
<script>
|
|
16
|
-
// The bundled script automatically calls initApp when loaded
|
|
17
|
-
// Ensure the root element exists
|
|
18
|
-
if (!document.getElementById('root').innerHTML) {
|
|
19
|
-
document.getElementById('root').innerHTML = '<div class="text-center mt-5"><div class="spinner-border text-primary" role="status"><span class="visually-hidden">Loading...</span></div><p class="mt-2">Loading ${appName}...</p></div>';
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
24
|
-
`.trim();
|
|
25
|
-
}
|
|
26
|
-
// Generate HTML for redirect
|
|
27
|
-
export function generateRedirectHtml(redirectUrl, message) {
|
|
28
|
-
return `
|
|
29
|
-
<!DOCTYPE html>
|
|
30
|
-
<html>
|
|
31
|
-
<head>
|
|
32
|
-
<title>Redirecting</title>
|
|
33
|
-
<meta http-equiv="refresh" content="0; url=${redirectUrl}" />
|
|
34
|
-
</head>
|
|
35
|
-
<body>
|
|
36
|
-
<p>${message} <a href="${redirectUrl}">here</a>...</p>
|
|
37
|
-
</body>
|
|
38
|
-
</html>
|
|
39
|
-
`.trim();
|
|
40
|
-
}
|