Open
Conversation
Add automated testing to catch ES module import issues: - New strict ES module test using Node.js directly - Updated CI pipeline to run ES module compliance check - Added npm script for ES module testing This prevents future regressions where missing .js extensions would break the SDK when consumed by ES module projects.
| * Test to verify ES module compliance by importing the built SDK | ||
| * This test runs against the compiled output to catch import issues | ||
| */ | ||
| import { createClient } from '../dist/index.js'; |
Collaborator
There was a problem hiding this comment.
does this really catch stuff? aren't we good with test:esm? might be nicer DX to not have to run build to run the unit tests
Collaborator
Author
There was a problem hiding this comment.
I verified it would have failed with the issue that I fixed in #33
if you have a better way to prevent sdk breaking prod let me know and I'll change
Collaborator
Author
There was a problem hiding this comment.
we can move to "e2e" to be semantically correct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background
This adds testing infrastructure to catch ES module import issues that would break the SDK when consumed by other ES module projects.
Changes
test-esm-strict.mjs: Strict Node.js ES module testtests/esm-compliance.test.js: Vitest-based compliance testpackage.json: Addedtest:esmscript and updated main test script.github/workflows/unit-tests.yml: Added ES module compliance check to CITest plan