Files
oh-my-opencode/script/publish-workflow.test.ts
T

32 lines
793 B
TypeScript
Raw Normal View History

/// <reference types="bun-types" />
2026-04-04 01:51:48 +09:00
import { describe, expect, test } from "bun:test"
import { readFileSync } from "node:fs"
2026-05-15 11:41:35 +09:00
const workflowChecks = [
{
path: new URL("../.github/workflows/ci.yml", import.meta.url),
testRuns: [
2026-05-15 16:26:57 +09:00
"run: bun test",
2026-05-15 11:41:35 +09:00
"run: bun test src/shared/dist-bundle-bun-globals.test.ts",
],
},
{
path: new URL("../.github/workflows/publish.yml", import.meta.url),
2026-05-15 16:26:57 +09:00
testRuns: ["run: bun test"],
2026-05-15 11:41:35 +09:00
},
2026-04-04 01:51:48 +09:00
]
describe("test workflows", () => {
2026-04-06 18:45:33 +09:00
test("use pure bun test for workflows", () => {
2026-05-15 11:41:35 +09:00
for (const workflowCheck of workflowChecks) {
// #given
2026-05-15 11:41:35 +09:00
const workflow = readFileSync(workflowCheck.path, "utf8")
2026-04-04 01:51:48 +09:00
2026-05-15 11:41:35 +09:00
for (const testRun of workflowCheck.testRuns) {
expect(workflow).toContain(testRun)
}
2026-04-04 01:51:48 +09:00
}
})
})