Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

829 B
Raw Blame
import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";

const bash =
  process.platform === "win32"
    ? [
        "C:\\Program Files\\Git\\bin\\bash.exe",
        "C:\\Program Files\\Git\\usr\\bin\\bash.exe",
      ].find(existsSync)
    : "/bin/bash";
const testWithBash = bash && existsSync(bash) ? it : it.skip;

describe("Server release recovery", () => {
  testWithBash("removes only the unactivated release owned by this run", () => {
    const script = fileURLToPath(
      new URL("./release-server-recovery.sh", import.meta.url),
    );
    const result = spawnSync(bash!, [script], { encoding: "utf8" });

    expect(result.status, `${result.stdout}\n${result.stderr}`).toBe(0);
  }, 15_000);
});