From bf7fd1a151b88075afa414b6cf9890920bdd92b5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 29 May 2026 17:37:19 +0900 Subject: [PATCH] test(workflow): assert bun test summary guard intent Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- script/publish-workflow.test.ts | 40 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/script/publish-workflow.test.ts b/script/publish-workflow.test.ts index ef2f3b070..6c04054d5 100644 --- a/script/publish-workflow.test.ts +++ b/script/publish-workflow.test.ts @@ -3,29 +3,25 @@ import { describe, expect, test } from "bun:test" import { readFileSync } from "node:fs" -const workflowChecks = [ - { - path: new URL("../.github/workflows/ci.yml", import.meta.url), - testRuns: [ - "run: bun test", - "run: bun test src/shared/dist-bundle-bun-globals.test.ts", - ], - }, - { - path: new URL("../.github/workflows/publish.yml", import.meta.url), - testRuns: ["run: bun test"], - }, -] - describe("test workflows", () => { - test("use pure bun test for workflows", () => { - for (const workflowCheck of workflowChecks) { - // #given - const workflow = readFileSync(workflowCheck.path, "utf8") + test("#given CI workflow #when tests run #then plain bun test is guarded by completion summary", () => { + // given + const workflow = readFileSync(new URL("../.github/workflows/ci.yml", import.meta.url), "utf8") - for (const testRun of workflowCheck.testRuns) { - expect(workflow).toContain(testRun) - } - } + // then + expect(workflow).toMatch(/bun test/) + expect(workflow).not.toContain("run-ci-tests") + expect(workflow).toContain("assert-test-summary") + expect(workflow).toContain("bun test src/shared/dist-bundle-bun-globals.test.ts") + }) + + test("#given publish workflow #when tests run #then plain bun test is guarded by completion summary", () => { + // given + const workflow = readFileSync(new URL("../.github/workflows/publish.yml", import.meta.url), "utf8") + + // then + expect(workflow).toMatch(/bun test/) + expect(workflow).not.toContain("run-ci-tests") + expect(workflow).toContain("assert-test-summary") }) })