diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml new file mode 100644 index 0000000..8426cd1 --- /dev/null +++ b/.github/workflows/bun-test.yml @@ -0,0 +1,28 @@ +# Created using @tscircuit/plop (npm install -g @tscircuit/plop) +name: Bun Test + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Run tests + run: bun test \ No newline at end of file diff --git a/tests/footprint-completeness.test.ts b/tests/footprint-completeness.test.ts new file mode 100644 index 0000000..4aa9113 --- /dev/null +++ b/tests/footprint-completeness.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, it } from "bun:test" +import { getFootprintNames } from "../src/footprinter" +import fs from "fs" +import path from "path" + +describe("footprint completeness", () => { + it("should expose all footprint functions from src/fn/", () => { + const fnDir = path.join(process.cwd(), "src", "fn") + const footprintFiles = fs + .readdirSync(fnDir) + .filter((file) => file.endsWith(".ts") && file !== "index.ts") + .map((file) => path.basename(file, ".ts")) + + const exposedFootprints = getFootprintNames() + + for (const file of footprintFiles) { + expect(exposedFootprints.includes(file)).toBe(true) + } + + for (const footprint of exposedFootprints) { + expect(footprintFiles.includes(footprint)).toBe(true) + } + + expect(footprintFiles.length).toBe(exposedFootprints.length) + }) +})