@testver/testver 0.2.1 → 0.2.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/index.js +25 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68539,7 +68539,7 @@ function mountResultsRoutes(app, resultsStore3, artifactFetcher) {
|
|
|
68539
68539
|
try {
|
|
68540
68540
|
const { scanAllTests: scanAllTests2 } = await Promise.resolve().then(() => (init_test_scanner(), test_scanner_exports));
|
|
68541
68541
|
const { generateHumanSteps: generateHumanSteps2 } = await Promise.resolve().then(() => (init_step_generator(), step_generator_exports));
|
|
68542
|
-
const { readFileSync:
|
|
68542
|
+
const { readFileSync: readFileSync49, existsSync: existsSync69 } = await import("fs");
|
|
68543
68543
|
const { resolve: resolve19, basename: basename14 } = await import("path");
|
|
68544
68544
|
const scanResult = scanAllTests2(run2.projectPath);
|
|
68545
68545
|
const allScannedTests = scanResult.suites.flatMap((s) => s.tests);
|
|
@@ -68553,7 +68553,7 @@ function mountResultsRoutes(app, resultsStore3, artifactFetcher) {
|
|
|
68553
68553
|
if (matchedTest?.line) {
|
|
68554
68554
|
const fullPath = resolve19(run2.projectPath, matchedTest.file);
|
|
68555
68555
|
if (existsSync69(fullPath)) {
|
|
68556
|
-
const content =
|
|
68556
|
+
const content = readFileSync49(fullPath, "utf-8");
|
|
68557
68557
|
const allLines = content.split("\n");
|
|
68558
68558
|
const endLine = Math.min(matchedTest.endLine || matchedTest.line + 50, allLines.length);
|
|
68559
68559
|
const source = allLines.slice(matchedTest.line - 1, endLine).join("\n");
|
|
@@ -74510,11 +74510,11 @@ function mountRecorderRoutes(app, wss, options) {
|
|
|
74510
74510
|
let mergeContext;
|
|
74511
74511
|
if (mergeMode && targetTestFile) {
|
|
74512
74512
|
try {
|
|
74513
|
-
const { readFileSync:
|
|
74513
|
+
const { readFileSync: readFileSync49, existsSync: existsSync69 } = await import("fs");
|
|
74514
74514
|
const { resolve: resolve19 } = await import("path");
|
|
74515
74515
|
const fullPath = resolve19(projectPath2, targetTestFile);
|
|
74516
74516
|
if (existsSync69(fullPath)) {
|
|
74517
|
-
const targetContent =
|
|
74517
|
+
const targetContent = readFileSync49(fullPath, "utf-8");
|
|
74518
74518
|
mergeContext = {
|
|
74519
74519
|
targetFile: targetTestFile,
|
|
74520
74520
|
targetContent,
|
|
@@ -88757,7 +88757,7 @@ function mountTestManagementRoutes(app, tmStore4, projectPath2) {
|
|
|
88757
88757
|
});
|
|
88758
88758
|
app.post("/api/tm/mappings/check-sync", async (_req, res) => {
|
|
88759
88759
|
try {
|
|
88760
|
-
const { existsSync: existsSync69, readFileSync:
|
|
88760
|
+
const { existsSync: existsSync69, readFileSync: readFileSync49 } = await import("fs");
|
|
88761
88761
|
const { createHash: createHash4 } = await import("crypto");
|
|
88762
88762
|
const mappings = tmStore4.listScriptMappings();
|
|
88763
88763
|
let syncedCount = 0;
|
|
@@ -88770,7 +88770,7 @@ function mountTestManagementRoutes(app, tmStore4, projectPath2) {
|
|
|
88770
88770
|
missingCount++;
|
|
88771
88771
|
continue;
|
|
88772
88772
|
}
|
|
88773
|
-
const content =
|
|
88773
|
+
const content = readFileSync49(fullPath, "utf-8");
|
|
88774
88774
|
const currentHash = createHash4("md5").update(content).digest("hex");
|
|
88775
88775
|
if (m.scriptHash && m.scriptHash !== currentHash) {
|
|
88776
88776
|
tmStore4.updateMappingSyncStatus(m.testCaseId, "script_updated", currentHash);
|
|
@@ -96999,12 +96999,20 @@ ${JSON.stringify(saved.spec.cells, null, 2).slice(0, 6e3)}
|
|
|
96999
96999
|
res.status(500).json({ error: String(error) });
|
|
97000
97000
|
}
|
|
97001
97001
|
});
|
|
97002
|
+
function getServerPackageVersion() {
|
|
97003
|
+
try {
|
|
97004
|
+
const dir = dirname9(fileURLToPath2(import.meta.url));
|
|
97005
|
+
return JSON.parse(readFileSync47(join67(dir, "..", "package.json"), "utf-8")).version || "0.0.0";
|
|
97006
|
+
} catch {
|
|
97007
|
+
return "0.0.0";
|
|
97008
|
+
}
|
|
97009
|
+
}
|
|
97002
97010
|
app.get("/api/health", (_req, res) => {
|
|
97003
97011
|
const uptime = process.uptime();
|
|
97004
97012
|
const memUsage = process.memoryUsage();
|
|
97005
97013
|
res.json({
|
|
97006
97014
|
status: "healthy",
|
|
97007
|
-
version:
|
|
97015
|
+
version: getServerPackageVersion(),
|
|
97008
97016
|
uptime: Math.round(uptime),
|
|
97009
97017
|
uptimeHuman: uptime > 86400 ? `${Math.floor(uptime / 86400)}d ${Math.floor(uptime % 86400 / 3600)}h` : uptime > 3600 ? `${Math.floor(uptime / 3600)}h ${Math.floor(uptime % 3600 / 60)}m` : `${Math.floor(uptime / 60)}m ${Math.round(uptime % 60)}s`,
|
|
97010
97018
|
memory: {
|
|
@@ -97889,6 +97897,7 @@ URL: ${url}
|
|
|
97889
97897
|
// src/index.ts
|
|
97890
97898
|
import { configDotenv } from "dotenv";
|
|
97891
97899
|
import { resolve as resolve18 } from "path";
|
|
97900
|
+
import { readFileSync as readFileSync48 } from "fs";
|
|
97892
97901
|
|
|
97893
97902
|
// src/repl/repl.ts
|
|
97894
97903
|
init_orchestrator();
|
|
@@ -99461,8 +99470,16 @@ configDotenv({ path: resolve18(process.cwd(), ".env"), quiet: true });
|
|
|
99461
99470
|
configDotenv({ path: resolve18(import.meta.dirname || ".", "..", ".env"), quiet: true });
|
|
99462
99471
|
var args = process.argv.slice(2);
|
|
99463
99472
|
var workingDirectory = process.cwd();
|
|
99473
|
+
function getPackageVersion() {
|
|
99474
|
+
try {
|
|
99475
|
+
const pkgPath = resolve18(import.meta.dirname || ".", "..", "package.json");
|
|
99476
|
+
return JSON.parse(readFileSync48(pkgPath, "utf-8")).version || "0.0.0";
|
|
99477
|
+
} catch {
|
|
99478
|
+
return "0.0.0";
|
|
99479
|
+
}
|
|
99480
|
+
}
|
|
99464
99481
|
if (args.includes("--version") || args.includes("-v")) {
|
|
99465
|
-
console.log(
|
|
99482
|
+
console.log(`testver v${getPackageVersion()}`);
|
|
99466
99483
|
process.exit(0);
|
|
99467
99484
|
}
|
|
99468
99485
|
if (args.includes("--help") || args.includes("-h")) {
|