Skip to content

Comments

test(agentkit): add comprehensive tests for applyGasMultiplier and re…#933

Closed
Dark-Brain07 wants to merge 1 commit intocoinbase:mainfrom
Dark-Brain07:feat/improve-utils-tests
Closed

test(agentkit): add comprehensive tests for applyGasMultiplier and re…#933
Dark-Brain07 wants to merge 1 commit intocoinbase:mainfrom
Dark-Brain07:feat/improve-utils-tests

Conversation

@Dark-Brain07
Copy link

Summary

This PR adds comprehensive test coverage for previously untested utility functions in the AgentKit TypeScript package.

Changes

New Tests for applyGasMultiplier

Added 6 test cases covering:

  • Standard gas scaling with multiplier
  • Multiplier of 1 (no change)
  • Multiplier less than 1 (reduction)
  • Rounding behavior verification
  • Very large gas values
  • Zero gas handling

New Tests for retryWithExponentialBackoff

Added 5 test cases covering:

  • First successful attempt returns immediately
  • Retry on failure and succeed eventually
  • Max retries exceeded throws error
  • Initial delay is respected
  • Exponential backoff delays are correctly applied (2^n formula)

Testing

All tests use Jest with fake timers for async testing and follow existing patterns in the codebase.

Run tests with:

cd typescript && pnpm test

@cb-heimdall
Copy link

cb-heimdall commented Jan 31, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@Dark-Brain07 Dark-Brain07 force-pushed the feat/improve-utils-tests branch from 769e3bc to 9b57b8c Compare February 14, 2026 09:48
@phdargen phdargen closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants