fix(test): register Docker import check with Vitest
This commit is contained in:
1 parent
1eee6661f9
commit
76e46d295c
1 file changed
+14
-10
@@ -1,13 +1,17 @@
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { spawnSync } from "node:child_process";
|
import { spawnSync } from "node:child_process";
|
||||||
|
|
||||||
const result = spawnSync(
|
import { it } from "vitest";
|
||||||
process.execPath,
|
|
||||||
[
|
it("imports runtime validation without starting the CMS", () => {
|
||||||
"--input-type=module",
|
const result = spawnSync(
|
||||||
"-e",
|
process.execPath,
|
||||||
"import {validateRuntime} from './scripts/docker-start.mjs';try{validateRuntime({});process.exit(1)}catch(error){if(!error.message.startsWith('Invalid runtime configuration'))throw error}",
|
[
|
||||||
],
|
"--input-type=module",
|
||||||
{ encoding: "utf8" },
|
"-e",
|
||||||
);
|
"import {validateRuntime} from './scripts/docker-start.mjs';try{validateRuntime({});process.exit(1)}catch(error){if(!error.message.startsWith('Invalid runtime configuration'))throw error}",
|
||||||
assert.equal(result.status, 0, result.stderr);
|
],
|
||||||
|
{ encoding: "utf8" },
|
||||||
|
);
|
||||||
|
assert.equal(result.status, 0, result.stderr);
|
||||||
|
});
|
||||||
Reference in new issue
Block a user