-
Notifications
You must be signed in to change notification settings - Fork 5
PLUG-22 Fixed Request Timout #36
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
aloisklink
left a comment
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.
@Prashant-7718, can you also add an [UNRELEASED] section to the packages/sdk/CHANGELOG.md file and describe this change there?
At least until we've switched over to something like changesets, it will mean that we at least have one way to tell consumers of the @mermaidchart/sdk what changes and improvements are in each release.
Other than that, thanks for fixing the CI!
packages/sdk/src/index.e2e.test.ts
Outdated
| if (!testProjectId) { | ||
| throw new Error( | ||
| 'Missing required environment variable TEST_MERMAIDCHART_PROJECT_ID. ' + | ||
| `Please go to ${new URL('/app/projects', baseURL)} and create one Project.`, |
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.
nitpick: Just a small grammar fix.
| `Please go to ${new URL('/app/projects', baseURL)} and create one Project.`, | |
| `Please go to ${new URL('/app/projects', baseURL)} and create a project.`, |
This pull request introduces a small but important change to the initialization order in the MermaidChart class constructor. It ensures that the requestTimeout property is set before calling setBaseURL, so the Axios instance is created with the correct timeout configuration.
It also improves the reliability and configurability of the SDK’s end-to-end (E2E) tests by moving test-specific settings to environment variables.
Changes included:
Updated the initialization order in the MermaidChart constructor so requestTimeout is set before invoking setBaseURL, ensuring the Axios client uses the correct timeout.
Improved the E2E test workflow by passing TEST_MERMAIDCHART_PROJECT_ID and TEST_MERMAIDCHART_BASE_URL via environment variables, making the tests more flexible and secure.