-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
enable esm support in Node v10 #4299
Conversation
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.
looks good, but we should probably add a test for this to be run on node 10. it could be something that checks the node version in a before hook, then runs invokeMocha
with the --experimental-modules
flag (this should run bin/mocha
)
would prefer another opinion from @mochajs/core but yeah, I think it's worth testing. @giltayar if you don't have the cycles to add it, we can merge and I can add it after. |
@boneskull I dunno. I don't think adding a test for v10 is worth the time and hassle. I don't see many people using Node.js v10 with modules. I certainly won't recommend it given that Node v10 ESM support is incompatible in certain ways with v>=12 Node support. And v10 is not the active LTS and is going to EOL mid next year. |
But your call, @boneskull. If you think it's worth it, let's merge, and I will add the test. |
my reasoning is that if we support node 10, people will be upset if we break it, and we won’t know if we break it unless there’s a test. |
@boneskull if y'all think it's worth testing, then I'll add a test. |
OK, the whole conversation took more than the change to also test it in Node v10. Sorry about that! |
netlify is being ornery; failure is unrelated |
test/integration/esm.spec.js
Outdated
@@ -39,6 +39,8 @@ describe('esm', function() { | |||
}); | |||
|
|||
it('should recognize esm files ending with .js due to package.json type flag', function(done) { | |||
if (!utils.supportsEsModules(true)) return done(); |
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.
You could use this.skip()
as well, but it doesn't really matter.
Resolved conflicts |
@giltayar your branch is broken, could you have a look, please? |
Some new ESM tests failed in Node v10. Specifically, those that assume that The function I switched the |
I believe the Netlify failure is unrelated to this PR. |
I don't know, it's the second time that netlify fails. Something is weird about you and netlify. |
The I also tried looking at the problem at Netlify and it said the page was not found or I have insufficient permissions. |
@juergba reverting the |
(It's not showing because the branch is on his fork, not on |
It's failing due to a caching problem |
I've rebased onto @giltayar: you opened this PR from your fork's |
clearing the cache before force-rebuilding worked. the problem is that we needed to add an fwiw, I don't like the |
here's the relevant travis build which, for some reason, I'm not seeing in the list of checks. |
Sorry. Learning about OSS as I go along. Won't happen again! |
Description of the Change
Fixes #4297. It seems that Mocha works with Node v10. So I enabled it to work in Node v10, but added documentation to say that it isn't officially supported and use at your own risk.