Skip to content

Add Cloudflare Workers Vitest test setup#44

Open
sounmind wants to merge 1 commit intomainfrom
feat/cloudflare-vitest-tests
Open

Add Cloudflare Workers Vitest test setup#44
sounmind wants to merge 1 commit intomainfrom
feat/cloudflare-vitest-tests

Conversation

@sounmind
Copy link
Copy Markdown
Member

@sounmind sounmind commented May 2, 2026

Summary

  • Cloudflare Workers Vitest integration์œผ๋กœ ํ…Œ์ŠคํŠธ ํ™˜๊ฒฝ์„ ์ „ํ™˜ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • package.json, bun.lock, vitest.config.js๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๊ธฐ์กด ํ…Œ์ŠคํŠธ๋ฅผ bun:test์—์„œ vitest๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • utils/github.js, utils/cors.js ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • cloudflare:test / cloudflare:workers ๊ธฐ๋ฐ˜ Worker runtime smoke test๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • CI๋ฅผ bun install ํ›„ bun run test ์‹คํ–‰์œผ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
  • README/AGENTS ํ…Œ์ŠคํŠธ ๋ฌธ์„œ๋ฅผ ์ƒˆ ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ๊ฐฑ์‹ ํ–ˆ์Šต๋‹ˆ๋‹ค.

Closes #2

Verification

bun run test
10 test files passed
106 tests passed

Notes

  • utils/github.js์˜ PKCS1 private key ์ฒ˜๋ฆฌ๋„ ์‹ค์ œ ์ง€์›๋˜๋„๋ก ๋ณด๊ฐ•ํ•˜๊ณ  ํšŒ๊ท€ ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋กœ์ปฌ workflow ์‚ฐ์ถœ๋ฌผ(.claude/, .omc/, docs/)์€ ์ปค๋ฐ‹์— ํฌํ•จํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

The project is deployed as a Cloudflare Worker, so the test harness now uses Cloudflare's Vitest pool instead of Bun's built-in runner. Existing tests were migrated to Vitest, utility crypto/CORS coverage was added for issue #2, and a small Worker runtime smoke test proves wrangler vars and request handling load through the Cloudflare test environment.

Constraint: Cloudflare Workers runtime APIs and wrangler bindings should be exercised through @cloudflare/vitest-pool-workers

Rejected: Keep Bun's built-in test runner as primary | it does not exercise Workers runtime bindings and had incompatible module mock behavior locally

Rejected: Maintain parallel Bun and Vitest suites | unnecessary duplicate maintenance for this small Worker

Confidence: high

Scope-risk: moderate

Directive: Keep docs/superpowers artifacts out of product commits unless the user explicitly asks to version workflow docs

Tested: bun run test (10 files, 106 tests); git diff --check; no bun:test/mock.module/vi.module leftovers

Not-tested: GitHub Actions execution on remote runner
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with ย Cloudflare Workers ย Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
โœ… Deployment successful!
View logs
github 3ae4b15 Commit Preview URL

Branch Preview URL
May 02 2026, 12:57 AM

@sounmind sounmind marked this pull request as ready for review May 2, 2026 00:58
@sounmind sounmind requested a review from SamTheKorean May 2, 2026 01:05
@sounmind sounmind self-assigned this May 2, 2026
@sounmind sounmind requested review from a team and removed request for SamTheKorean May 2, 2026 01:05
@soobing soobing self-requested a review May 2, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

์œ ๋‹› ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€

1 participant