-
Notifications
You must be signed in to change notification settings - Fork 11
Make testInboxID
optional param
#70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…date test inbox ID only in sandbox mode
WalkthroughThe changes introduce a private validation method in Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/lib/MailtrapClient.ts
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/lib/MailtrapClient.ts (1)
src/lib/MailtrapError.ts (1)
MailtrapError
(1-1)
🔇 Additional comments (4)
src/lib/MailtrapClient.ts (4)
35-35
: LGTM: Minor reordering of constants.The reordering of error constants doesn't affect functionality but appears to be a stylistic preference.
131-133
: LGTM: Improved documentation.Good addition of JSDoc comment for consistency with other getter methods.
167-169
: LGTM: Appropriate validation for sandbox mode.The validation correctly enforces that
testInboxId
is required when in sandbox mode, aligning with the PR objective of making it optional for other use cases.
172-172
: LGTM: Correct URL construction logic.The updated URL construction appropriately includes
testInboxId
only when both sandbox mode is active andtestInboxId
is present.
…n testInboxId is missing in sandbox mode
… improved code clarity
…own when testInboxId is missing in sandbox mode during batch sending
@@ -664,20 +706,6 @@ describe("lib/mailtrap-client: ", () => { | |||
}); | |||
|
|||
describe("get testing(): ", () => { | |||
it("rejects with Mailtrap error, when `testInboxId` is missing.", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice to have a test that the absence of testInboxId
doesn't raise an error when client.testing
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And remove testInboxId
from all client setup cases where it's not needed anymore (like here).
…n accountId is provided without testInboxId
Motivation
Unblock using the testing api without
testInboxId
.Summary by CodeRabbit
Bug Fixes
Documentation