Skip to content

Functionality vitest tests#2

Closed
joshkotrous wants to merge 2 commits intomainfrom
cursor/functionality-vitest-tests-8110
Closed

Functionality vitest tests#2
joshkotrous wants to merge 2 commits intomainfrom
cursor/functionality-vitest-tests-8110

Conversation

@joshkotrous
Copy link
Copy Markdown
Contributor

Add Vitest unit tests for CI and GitLab modules, including API mocking.


Open in Cursor Open in Web

- Install vitest and configure it with vitest.config.ts
- Add 27 tests for src/lib/ci.ts covering:
  - Environment variable helpers
  - getApiUrl for dev/staging/production environments
  - dispatchScan with fetch mocking
  - getScanStatus with fetch mocking
  - pollScanStatus with fake timers
  - runScan orchestrator
- Add 8 tests for src/lib/gitlab.ts covering:
  - GitLab CI env var mapping
  - Success/failure exit code behavior
  - Environment and scan level passthrough
- Mock global fetch for API tests
- Mock CI module for gitlab integration tests

Co-authored-by: Josh Kotrous <joshkotrous@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 6, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: Josh Kotrous <joshkotrous@users.noreply.github.com>
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.

2 participants