-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Remove esModuleInterop from ts-node #7808
fix: Remove esModuleInterop from ts-node #7808
Conversation
Thanks for taking the time to open a PR!
|
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.
We need a test for this, using a TS project fixture in packages/server and e2e test probably is enough for this
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.
The e2e
project here is confusing... it appears we are attempting to test the failure case of an import with esModuleInterop: false
right?
It's weird that there are spec files (but don't ever even get run) because the failure happens in the pluginsFile
.
I would prefer we actually use a real test failure in a spec file (for instance, asserting that the exported module does or not does have the add
function).
It would actually be better to assert in the affirmative and receive a passing test that would otherwise fail with esModuleInterop: true
by default.
The test name itself (and comments) could explain why, and reference the original issue. As it stands its very confusing because there's no context as to why the snapshot value of the e2e test is correct or not.
It seems that there is no alternative. 1. About using spec files. As we know, spec files and plugin/support files use different TypeScript transpiler settings. As for spec files, using opinionated typescript setting is necessary because tsify doesn't have Because of that, using spec files cannot test if I explained this in the 2. Creating affirmative test. I found out that it's impossible to create an affirmative test with
I changed it to simply export |
Hello! Is this likely to land in 5.0? See to have stalled for a few weeks. Is there anything I can do to help? |
@robcresswell We're still reviewing the final 5.0 features. Hopefully this gets in. #7753 |
Ah sorry, thats poor research on my part. Thanks for the link @jennifer-shehane! |
@sainthkh Will this require any notes on our Migration Guide? Any updates people will need to be aware of for changes they need to make? I just noticed this is the only 5.0 PR that doesn't have specific docs updates. |
When a user doesn't have a tsconfig.json file or define I used 'might', because it wouldn't fail when a user didn't use |
Merging this into #8143 and continuing any work there. |
55e97a1
into
cypress-io:tr-132-change-esmodule-interop-default
…sor (#8143) * make tests preprocessor agnostic * update eslintignore * put back deps needed for e2e test * remove obselete snapshot it was replaced by 1_typescript_support_spec.ts.js * switch from browserify to webpack preprocessor * cmon github * fix/update tests * bump preprocessor and update snapshots * update snapshots * bump preprocessor to gain json support * fix e2e tests with webpack-originated errors * bump preprocessor version, fix node globals * update snapshot * remove support for ? in file path * bump preprocessor version * bump preprocessor again * bump preprocessor * bump preprocessor * update snapshots * bump preprocessor version * bump preprocessor, quiet the paths plugin * add test verifying tsconfig paths work * refactor registering ts-node * separate spec/support file typescript tests from plugins file typescript tests * fix unit tests * fix: Remove esModuleInterop default from ts-node (#7808) * Remove esModuleInterop from ts-node. * Add e2e test. * Fix test. Change test name. Add comment. * Fix test snapshot name. * update snapshotting Co-authored-by: Chris Breiding <[email protected]> * clean up e2e project * bump preprocessor to 1.3.2, which removes esModuleInterop default value * improve esmoduleinterop e2e tests * change spec file * bump batteries-included preprocessor and install latest webpack preprocessor beside it * update snapshots * put back snapshot * update snapshot * update snapshot Co-authored-by: Kukhyeon Heo <[email protected]> Co-authored-by: Brian Mann <[email protected]>
User facing changelog
This option prevents users from not using it.
Additional details
Why was this change necessary?
This option is too opinionated.
What is affected by this change?
A project will break if it meets these 3 conditions:
tsconfig.json
fileimport Foo from 'foo'
styleAny implementation details to explain?
N/A
How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?