Skip to content

Cover AWS_REGION default branch in use()#63

Merged
recursivefunk merged 1 commit into
mainfrom
jra/cover-aws-region-default
Apr 22, 2026
Merged

Cover AWS_REGION default branch in use()#63
recursivefunk merged 1 commit into
mainfrom
jra/cover-aws-region-default

Conversation

@recursivefunk

Copy link
Copy Markdown
Owner

Summary

Closes the last remaining uncovered branch in src/index.js: the || 'us-east-1' fallback in use() when process.env.AWS_REGION is unset. Test-only change — no library behavior changes, no version bump.

Changed Files

  • test/test.js — new test use() defaults region to us-east-1 when AWS_REGION is unset. Uses a local spy SecretsManagerClient whose constructor captures region, then deletes process.env.AWS_REGION before calling env.use() and restores it in a finally block so subsequent tests (which rely on AWS_REGION) still pass.

Steps to Verify

  • npm run ci — all 131 tests pass.
  • The coverage report shows Uncovered Line #s empty and branch coverage at 100% for src/index.js (was 98.95% with line 50 flagged).

Adds a test that deletes process.env.AWS_REGION before calling
env.use(), with a spy SecretsManagerClient that captures the region
passed to its constructor. This exercises the `|| 'us-east-1'`
fallback that was previously unreached, taking branch coverage on
src/index.js to 100%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@recursivefunk recursivefunk self-assigned this Apr 22, 2026
@recursivefunk recursivefunk merged commit 3f3bdf0 into main Apr 22, 2026
1 check passed
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.

1 participant