chore: cover SDK base64 helpers - #409
Conversation
|
@mittalsonal is attempting to deploy a commit to the ankanmisra's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdded direct TypeScript tests for UTF-8 Base64 encoding and decoding. The tests cover Unicode round-trips, strict invalid-input handling, missing ChangesBase64 helper test coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sdk/typescript/src/__tests__/base64.test.ts`:
- Around line 4-17: Update the global capability setup around
setGlobalCapability and the afterEach cleanup to preserve each original atob and
btoa property state, including whether the property was absent. Restore the
saved descriptor or remove the global when it was originally missing, rather
than always assigning the captured value, so subsequent tests regain the
original capability state.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ba2bd6f-3836-45ef-83fe-fe5fa630636d
📒 Files selected for processing (1)
sdk/typescript/src/__tests__/base64.test.ts
|
Maintainer note: the CodeRabbit finding about preserving/restoring the original global |
|
@codex review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c82a24e8ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
d48440d to
5061ffe
Compare
Summary
atob/btoaruntime errors.Closes #260
Type Of Change
Affected Areas
gateway/)verifier/)web/)tests/,run_e2e.sh)bench/)deploy/, Docker, env, workflows)sdk/typescript/)Contributor Checklist
Verification
List the exact commands you ran and their result.
Screenshots
Not applicable - SDK unit test coverage only, no visible UI changes.
Notes For Reviewers
Production code is intentionally unchanged. The new tests import the helper module directly and avoid Node
Bufferfor the behavior under test.Summary by CodeRabbit
Note
Add test coverage for SDK base64 UTF-8 helpers
Adds a Bun test suite in base64.test.ts covering
encodeUtf8ToBase64anddecodeBase64ToUtf8. Tests include round-trips for ASCII, accented Latin, Devanagari, and emoji strings, known-good decode fixtures, empty string handling, invalid input error cases, and errors whenatob/btoaare unavailable (simulated viaObject.defineProperty/Reflect.deleteProperty).Macroscope summarized 5061ffe.