Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pm-stack/opencode-claimant/test/install.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test";
import { afterAll, describe, expect, test } from "bun:test";
import { spawnSync } from "node:child_process";
import {
mkdir, mkdtemp, readFile, readdir, rm, writeFile,
Expand All @@ -17,6 +17,11 @@
join(here, "..", "migration-0022.sql"), "utf8",
);
const installer = join(here, "..", "install.mjs");
const bunInstallState = await mkdtemp(join(tmpdir(), "opencode-claimant-bun-"));

afterAll(async () => {
await rm(bunInstallState, { recursive: true, force: true });
});

async function makeStores() {
const home = await mkdtemp(join(tmpdir(), "opencode-claimant-install-"));
Expand All @@ -43,14 +48,14 @@
function runInstaller(home, args) {
return spawnSync(process.execPath, [installer, ...args], {
encoding: "utf8",
env: { ...process.env, HOME: home },
env: { ...process.env, HOME: home, BUN_INSTALL: bunInstallState },
});
}

async function expectNoWrites(stores) {
expect(await readFile(stores.defaultStore, "utf8")).toBe(stores.original);
expect(await readFile(stores.explicitStore, "utf8")).toBe(stores.original);
expect(await readdir(stores.home)).toEqual([

Check failure on line 58 in pm-stack/opencode-claimant/test/install.test.mjs

View workflow job for this annotation

GitHub Actions / aggregator + projector + dispatch + python suites + quota exporters

error: expect(received).toEqual(expected)

[ ".config", + ".bun", "explicit-store.json", ] - Expected - 0 + Received + 1 at expectNoWrites (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:58:38) at async <anonymous> (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:223:13)

Check failure on line 58 in pm-stack/opencode-claimant/test/install.test.mjs

View workflow job for this annotation

GitHub Actions / aggregator + projector + dispatch + python suites + quota exporters

error: expect(received).toEqual(expected)

[ ".config", + ".bun", "explicit-store.json", ] - Expected - 0 + Received + 1 at expectNoWrites (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:58:38) at async rejectsBeforeWrites (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:74:11) at async <anonymous> (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:204:11)

Check failure on line 58 in pm-stack/opencode-claimant/test/install.test.mjs

View workflow job for this annotation

GitHub Actions / aggregator + projector + dispatch + python suites + quota exporters

error: expect(received).toEqual(expected)

[ ".config", + ".bun", "explicit-store.json", ] - Expected - 0 + Received + 1 at expectNoWrites (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:58:38) at async rejectsBeforeWrites (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:74:11) at async <anonymous> (/home/runner/work/code/code/pm-stack/opencode-claimant/test/install.test.mjs:189:11)
".config", "explicit-store.json",
]);
expect(await readdir(stores.defaultDir)).toEqual([
Expand Down
Loading