chore: add test infrastructure and initial test suite#91
chore: add test infrastructure and initial test suite#91dtoxvanilla1991 wants to merge 2 commits into
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 3 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai resume |
✅ Actions performedReviews resumed. |
Port of community PR #57 by @p-stam001 (adapted for current main). - Add vitest.config.ts with node environment, v8 coverage, include/exclude patterns, and @ alias - Add lib/constants.test.ts: 3 tests for DEFAULT_TOKEN_SCOPES - Add lib/types.test.ts: 15 tests covering all exported types including a second UserProfile test that exercises the optional fields - No new dependencies needed (vitest/coverage-v8 already on main) - Drops jsdom devDep from original PR (not needed with node environment) - Drops globals: true and react() plugin (unnecessary for node env)
All UserProfile fields are required in types.ts; the test asserting only 'id' is required was incorrect. Addresses review feedback from Koosha-Owji on PR #91.
17494bb to
5840e44
Compare
|
@Koosha-Owji please re-review. Thanks |
Ports the test additions from community PR #57 (by @p-stam001) onto current
main, adapted for the current stack.What's added
vitest.config.ts- explicit vitest configuration withnodeenvironment, v8 coverage (text/json/html reporters), include/exclude patterns scoped tolib/, and@alias pointing to/liblib/constants.test.ts- 3 tests forDEFAULT_TOKEN_SCOPESlib/types.test.ts- 15 tests covering all exported types:LoginSuccessResponse,LoginFailureResponse,LoginResponse,LogoutRequest,LogoutResult,PermissionAccess,Permissions, andUserProfile(including a test for the optional-fields case)What was changed vs. PR #57
vitestand@vitest/coverage-v8are already onmainat^4.0.0jsdomdevDep - the environment isnode, so jsdom is not neededglobals: true- test files use explicitimport { describe, it, expect } from 'vitest'imports, consistent with the existing codebase style@vitejs/plugin-reactfrom vitest config - not needed for node-env tests (it's already invite.config.tsfor the build)UserProfiletest asserting that onlyidis required (exercising the optional fields added in chore: upgrade TypeScript to v6 with migration fixes #90)Test results
Closes #57