Skip to content
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

Disable experimental warning #57

Open
shwao opened this issue Apr 6, 2023 · 1 comment
Open

Disable experimental warning #57

shwao opened this issue Apr 6, 2023 · 1 comment

Comments

@shwao
Copy link

shwao commented Apr 6, 2023

I get the message (node:5051) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time for every test that runs. That kind of clutters the logs. This could be disabled by adding '--no-warnings=ExperimentalWarning' to the args in this line:

const args = ['--loader', loader, '--test', ...getOptionFlags(options), ...resolvedTestPaths]

Would you accept in a PR from me for this change? Or should it be behind a flag/option?

@meyfa
Copy link
Owner

meyfa commented Apr 6, 2023

I would be open to disabling this warning. Unfortunately it's not as simple, since Node.js doesn't actually support the --no-warnings=ExperimentalWarning syntax. Relevant discussion: nodejs/node#46862, and a PR to make the Node.js documentation reflect its behavior: nodejs/node#47031

Even then, this would disable all ExperimentalWarnings, even ones caused by the code under test, which doesn't feel optimal.

Right now, it's already possible to disable these warnings via the NODE_OPTIONS environment variable:

NODE_OPTIONS=--no-warnings ts-node-test test/

I'll gladly accept a PR for either of the following:

  • Adding support for passing --no-warnings directly to ts-node-test, i.e., ts-node-test --no-warnings test/
  • Suppressing the ExperimentalWarning for ESM loaders specifically (but not all other warnings, too)

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

No branches or pull requests

2 participants