mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-13 06:03:39 -06:00
c70aee247e
* refactor(scripts): migrate JavaScript tools to TypeScript * fix(ci): keep changed-scope preflight zero-install * fix(ci): preserve zero-install script owners * fix(ci): complete script migration follow-through * fix(release): keep stable closeout zero-install * fix(scripts): preserve standalone execution boundaries * fix(scripts): repair standalone loader boundaries * fix(scripts): normalize gateway observation ids * fix(scripts): keep Docker packager standalone * test(scripts): preserve rebase cleanup helpers * test(sessions): use tracked temp directory
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
// Runtime Postbuild Stamp tests cover runtime postbuild stamp script behavior.
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { afterEach, describe, expect, it } from "vitest";
|
|
import { RUNTIME_POSTBUILD_STAMP_FILE } from "../../scripts/lib/local-build-metadata-paths.mts";
|
|
import { writeRuntimePostBuildStamp } from "../../scripts/runtime-postbuild-stamp.mts";
|
|
import { useAutoCleanupTempDirTracker } from "../helpers/temp-dir.js";
|
|
|
|
describe("runtime-postbuild-stamp script", () => {
|
|
const tempDirs = useAutoCleanupTempDirTracker(afterEach);
|
|
|
|
it("writes dist/.runtime-postbuildstamp with the current git head", () => {
|
|
const rootDir = tempDirs.make("openclaw-runtime-postbuild-stamp-");
|
|
const stampPath = writeRuntimePostBuildStamp({
|
|
cwd: rootDir,
|
|
now: () => 123,
|
|
spawnSync: () => ({ status: 0, stdout: "abc123\n" }),
|
|
});
|
|
|
|
expect(path.relative(rootDir, stampPath)).toBe(path.join("dist", RUNTIME_POSTBUILD_STAMP_FILE));
|
|
expect(JSON.parse(fs.readFileSync(stampPath, "utf8"))).toEqual({
|
|
syncedAt: 123,
|
|
head: "abc123",
|
|
});
|
|
});
|
|
});
|