@elench/testkit 0.1.76 → 0.1.78
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/README.md +49 -30
- package/lib/app/doctor.mjs +43 -0
- package/lib/config/runtime.test.mjs +2 -2
- package/lib/config-api/index.d.ts +226 -78
- package/lib/config-api/index.mjs +137 -271
- package/lib/config-api/index.test.mjs +347 -155
- package/lib/config-api/profiles.mjs +640 -0
- package/lib/coverage/index.test.mjs +2 -2
- package/lib/shared/build-config.test.mjs +1 -1
- package/lib/shared/configured-steps.mjs +9 -7
- package/lib/shared/configured-steps.test.mjs +3 -3
- package/node_modules/@elench/next-analysis/package.json +1 -1
- package/node_modules/@elench/testkit-bridge/package.json +2 -2
- package/node_modules/@elench/testkit-protocol/package.json +1 -1
- package/node_modules/@elench/ts-analysis/package.json +1 -1
- package/package.json +5 -5
|
@@ -53,8 +53,8 @@ export function normalizeConfiguredStep(step, label) {
|
|
|
53
53
|
|
|
54
54
|
const kind = normalizeOptionalString(step.kind);
|
|
55
55
|
if (kind === "command") {
|
|
56
|
-
const cmd = normalizeOptionalString(step.
|
|
57
|
-
if (!cmd) throw new Error(`${label}.
|
|
56
|
+
const cmd = normalizeOptionalString(step.run);
|
|
57
|
+
if (!cmd) throw new Error(`${label}.run must be a non-empty string`);
|
|
58
58
|
return {
|
|
59
59
|
kind,
|
|
60
60
|
cmd,
|
|
@@ -73,8 +73,8 @@ export function normalizeConfiguredStep(step, label) {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
if (kind === "module") {
|
|
76
|
-
const specifier = normalizeOptionalString(step.
|
|
77
|
-
if (!specifier) throw new Error(`${label}.
|
|
76
|
+
const specifier = normalizeOptionalString(step.target);
|
|
77
|
+
if (!specifier) throw new Error(`${label}.target must be a non-empty string`);
|
|
78
78
|
return {
|
|
79
79
|
kind,
|
|
80
80
|
specifier,
|
|
@@ -118,7 +118,8 @@ export function collectConfiguredInputs(productDir, { inputs = [], steps = [] }
|
|
|
118
118
|
collected.add(resolveConfiguredPath(productDir, step.cwd, step.path));
|
|
119
119
|
}
|
|
120
120
|
if (step.kind === "module") {
|
|
121
|
-
const
|
|
121
|
+
const moduleRef = step.specifier || step.target;
|
|
122
|
+
const { modulePath } = parseModuleSpecifier(moduleRef);
|
|
122
123
|
const candidatePath = resolveConfiguredPath(productDir, step.cwd, modulePath);
|
|
123
124
|
if (modulePath.startsWith("@elench/testkit") || fs.existsSync(candidatePath)) {
|
|
124
125
|
if (!modulePath.startsWith("@elench/testkit")) {
|
|
@@ -138,7 +139,7 @@ export function collectConfiguredInputs(productDir, { inputs = [], steps = [] }
|
|
|
138
139
|
export function summarizeConfiguredStep(step) {
|
|
139
140
|
if (step.kind === "command") return `command: ${String(step.cmd).trim()}`;
|
|
140
141
|
if (step.kind === "sql-file") return `sql: ${step.path}`;
|
|
141
|
-
if (step.kind === "module") return `module: ${step.specifier}`;
|
|
142
|
+
if (step.kind === "module") return `module: ${step.specifier || step.target}`;
|
|
142
143
|
return step.kind;
|
|
143
144
|
}
|
|
144
145
|
|
|
@@ -174,7 +175,8 @@ export function validateConfiguredCollection({ productDir, label, inputs = [], s
|
|
|
174
175
|
ensureExistingPath(resolveConfiguredPath(productDir, step.cwd, step.path), `${label} sql file`);
|
|
175
176
|
}
|
|
176
177
|
if (step.kind === "module") {
|
|
177
|
-
const
|
|
178
|
+
const moduleRef = step.specifier || step.target;
|
|
179
|
+
const { modulePath } = parseModuleSpecifier(moduleRef);
|
|
178
180
|
const candidatePath = resolveConfiguredPath(productDir, step.cwd, modulePath);
|
|
179
181
|
if (modulePath.startsWith("@elench/testkit")) {
|
|
180
182
|
// Internal testkit module steps are resolved by the runtime alias map.
|
|
@@ -22,7 +22,7 @@ afterEach(() => {
|
|
|
22
22
|
describe("shared configured steps", () => {
|
|
23
23
|
it("normalizes and finalizes configured steps", () => {
|
|
24
24
|
const normalized = normalizeConfiguredStep(
|
|
25
|
-
{ kind: "module",
|
|
25
|
+
{ kind: "module", target: "./seed.mjs#run", cwd: "db", inputs: ["schema.sql"] },
|
|
26
26
|
'Service "api" database.template.seed[0]'
|
|
27
27
|
);
|
|
28
28
|
|
|
@@ -55,7 +55,7 @@ describe("shared configured steps", () => {
|
|
|
55
55
|
inputs: ["db/schema.sql"],
|
|
56
56
|
steps: [
|
|
57
57
|
{ kind: "sql-file", path: "schema.sql", cwd: "db", inputs: [] },
|
|
58
|
-
{ kind: "module",
|
|
58
|
+
{ kind: "module", target: "./seed.mjs#run", cwd: "db", inputs: [] },
|
|
59
59
|
],
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -82,7 +82,7 @@ describe("shared configured steps", () => {
|
|
|
82
82
|
steps: [
|
|
83
83
|
{
|
|
84
84
|
kind: "module",
|
|
85
|
-
|
|
85
|
+
target: "@elench/testkit/config/next-runtime-tsconfig#writeNextRuntimeTsconfig",
|
|
86
86
|
cwd: "frontend",
|
|
87
87
|
inputs: [],
|
|
88
88
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"description": "Browser bridge helpers for testkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@elench/testkit-protocol": "0.1.
|
|
25
|
+
"@elench/testkit-protocol": "0.1.78"
|
|
26
26
|
},
|
|
27
27
|
"private": false
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elench/testkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"description": "CLI for discovering and running local HTTP, DAL, and Playwright test suites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@babel/code-frame": "^7.29.0",
|
|
84
|
-
"@elench/next-analysis": "0.1.
|
|
85
|
-
"@elench/testkit-bridge": "0.1.
|
|
86
|
-
"@elench/testkit-protocol": "0.1.
|
|
87
|
-
"@elench/ts-analysis": "0.1.
|
|
84
|
+
"@elench/next-analysis": "0.1.78",
|
|
85
|
+
"@elench/testkit-bridge": "0.1.78",
|
|
86
|
+
"@elench/testkit-protocol": "0.1.78",
|
|
87
|
+
"@elench/ts-analysis": "0.1.78",
|
|
88
88
|
"@oclif/core": "^4.10.6",
|
|
89
89
|
"esbuild": "^0.25.11",
|
|
90
90
|
"execa": "^9.5.0",
|