Skip to content

feat: Add vitest test setup and CI workflow to all JS/TS templates#719

Open
B4nan wants to merge 8 commits intomasterfrom
add-vitest-setup
Open

feat: Add vitest test setup and CI workflow to all JS/TS templates#719
B4nan wants to merge 8 commits intomasterfrom
add-vitest-setup

Conversation

@B4nan
Copy link
Member

@B4nan B4nan commented Mar 13, 2026

Summary

  • Add vitest as devDependency to all 25 JS/TS templates
  • Replace placeholder test scripts with vitest run
  • Add example test file (test/main.test.js / test/main.test.ts) to each template
  • Add .github/workflows/test.yaml CI workflow to each template:
    • JS templates: install + test
    • TS templates: install + build (type checking via tsc) + test
    • ts-start-bun: uses oven-sh/setup-bun instead of Node

🤖 Generated with Claude Code

- Add vitest as devDependency and update test script in all 25 JS/TS templates
- Add example test file (test/main.test.js or test/main.test.ts)
- Add GitHub Actions CI workflow: JS templates run tests, TS templates build + test
- ts-start-bun uses Bun-specific workflow with oven-sh/setup-bun
- ts-playwright-test-runner gets vitest.config.ts to avoid conflicting with Playwright specs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added this to the 136th sprint - Tooling team milestone Mar 13, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Mar 13, 2026
B4nan and others added 3 commits March 13, 2026 16:16
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… templates

- Replace placeholder `expect(1+1).toBe(2)` tests with real crawler tests
  in all 10 crawlee templates (cheerio, playwright, puppeteer)
- Tests actually run the crawler against https://www.example.com and
  verify title extraction
- Add `npx playwright install --with-deps chromium` CI step for
  playwright-based templates
- Remove vitest setup from js-cypress and ts-playwright-test-runner
  since they already have their own test frameworks (Cypress, Playwright Test)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Mar 13, 2026
B4nan and others added 4 commits March 19, 2026 11:22
- Sort named imports alphabetically to satisfy simple-import-sort/imports
- Reorder module imports so @crawlee/* comes before vitest
- Add ./test/**/* to tsconfig.json include in all TS templates so
  typescript-eslint parser can resolve test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adding test files to tsconfig.json broke Docker builds because tsc
compiled them and hit type errors. Instead, exclude **/test from
eslint in TS templates and revert tsconfig.json to only include src.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants