test(package): stabilize package layout dry-runs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { describe, expect, setDefaultTimeout, test } from "bun:test"
|
||||
import { existsSync, readdirSync } from "node:fs"
|
||||
import { join, relative, sep } from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
@@ -6,10 +6,13 @@ import { fileURLToPath } from "node:url"
|
||||
const repositoryRoot = fileURLToPath(new URL("..", import.meta.url))
|
||||
const commandRoots = [".opencode/command", ".agents/command"] as const
|
||||
const skillRoots = [".opencode/skills", ".agents/skills"] as const
|
||||
const packageLayoutTestTimeoutMs = 60_000
|
||||
|
||||
setDefaultTimeout(packageLayoutTestTimeoutMs)
|
||||
|
||||
class PackDryRunError extends Error {
|
||||
constructor(readonly exitCode: number, readonly stderr: string) {
|
||||
super(`bun pm pack --dry-run failed with exit code ${exitCode}: ${stderr}`)
|
||||
super(`bun pm pack --dry-run --ignore-scripts failed with exit code ${exitCode}: ${stderr}`)
|
||||
this.name = "PackDryRunError"
|
||||
}
|
||||
}
|
||||
@@ -98,7 +101,7 @@ function parsePackedPaths(output: string): Set<string> {
|
||||
|
||||
async function packDryRunPaths(): Promise<Set<string>> {
|
||||
const packProcess = Bun.spawn({
|
||||
cmd: ["bun", "pm", "pack", "--dry-run"],
|
||||
cmd: ["bun", "pm", "pack", "--dry-run", "--ignore-scripts"],
|
||||
cwd: repositoryRoot,
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
|
||||
Reference in New Issue
Block a user