Files
ConvertX/tests/converters/assimp.test.ts
Emrik Östling 2135c6b9f1 chore: use bun fmt and bun check (#685)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-23 18:23:49 +02:00

29 lines
987 B
TypeScript

import { expect, test } from "bun:test";
import { convert } from "../../src/converters/assimp";
import { runCommonTests } from "./helpers/commonTests";
import { createMockExecFile } from "./helpers/converters";
runCommonTests(convert);
test("invokes assimp export with the target format id", async () => {
const { execFile, calls } = createMockExecFile();
await convert("in/scene.obj", "obj", "stl", "out/scene.stl", undefined, execFile);
expect(calls).toEqual([
{ cmd: "assimp", args: ["export", "in/scene.obj", "out/scene.stl", "-fstl"] },
]);
});
test("passes format ids that are not file extensions through unchanged", async () => {
// e.g. glb2 is written to a .glb file, but assimp still needs -fglb2
const { execFile, calls } = createMockExecFile();
await convert("in/scene.obj", "obj", "glb2", "out/scene.glb", undefined, execFile);
expect(calls).toEqual([
{ cmd: "assimp", args: ["export", "in/scene.obj", "out/scene.glb", "-fglb2"] },
]);
});