Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { describe, expect, test } from "bun:test";
import { spawnSync } from "node:child_process";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

import { loadKickoffThreadTsOrBail } from "../cli/comments.ts";

const TEST_SLACK_CHANNEL = "C123TEST";

const CLI_PATH = new URL("../cli.ts", import.meta.url).pathname;
const SCRIPTS_DIR = new URL("..", import.meta.url).pathname;
const CLI_PATH = fileURLToPath(new URL("../cli.ts", import.meta.url));
const SCRIPTS_DIR = dirname(CLI_PATH);

describe("comment CLI", () => {
test("Refuses to post without --task or --thread-ts", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { describe, expect, test } from "bun:test";
import { spawnSync } from "node:child_process";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";

const SCRIPTS_DIR = new URL("..", import.meta.url).pathname;
const SCRIPTS_DIR = dirname(
fileURLToPath(new URL("../cli.ts", import.meta.url))
);

import {
findActiveRootPlanner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { spawnSync } from "node:child_process";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { fileURLToPath } from "node:url";

function runPromptWithPlan(plan: unknown): ReturnType<typeof spawnSync> {
const workspace = mkdtempSync(join(tmpdir(), "orchestrate-plan-migration-"));
writeFileSync(join(workspace, "plan.json"), JSON.stringify(plan, null, 2));

const cliPath = new URL("../cli.ts", import.meta.url).pathname;
const cliPath = fileURLToPath(new URL("../cli.ts", import.meta.url));
try {
return spawnSync(
process.execPath,
Expand Down