From 104c4af782f4f4e649d3f77f7b22d0b356985bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Krzeslak?= Date: Mon, 10 Aug 2026 21:42:41 +0200 Subject: [PATCH] fix: improve assimp version output and unit test --- src/helpers/printVersions.ts | 3 ++- tests/helpers/printVersions.test.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers/printVersions.ts b/src/helpers/printVersions.ts index b6e7225..3098685 100644 --- a/src/helpers/printVersions.ts +++ b/src/helpers/printVersions.ts @@ -121,7 +121,8 @@ if (process.env.NODE_ENV === "production") { } if (stdout) { - console.log(`assimp ${stdout.split("\n")[5]}`); + const firstLines = (stdout || "").split("\n"); + console.log(`assimp ${firstLines[5] || firstLines[0] || ""}`); } }); diff --git a/tests/helpers/printVersions.test.ts b/tests/helpers/printVersions.test.ts index 1512cd7..1b4a332 100644 --- a/tests/helpers/printVersions.test.ts +++ b/tests/helpers/printVersions.test.ts @@ -27,7 +27,7 @@ mock.module("node:child_process", () => ({ // assimp's real output is multi-line; the source reads line index 5. if (cmd.startsWith("assimp")) { - cb(null, "l1\nl2\nl3\nl4\nl5\nassimp v1.0.0\n"); + cb(null, "l1\nl2\nl3\nl4\nl5\nVersion 1.0.0 (GIT commit abc123)\n"); return; }