-
Notifications
You must be signed in to change notification settings - Fork 10
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
ESM entry? #1
Comments
There probably is more work necessary to make this run in browsers, for example this relies on I think a rewrite for browsers could be the way to go. Not sure yet. |
Hi, is there still a plan to make Came here after being redirected from Isomorphic Test Runner issue I opened on main node repo: What is the problem this feature will solve?Currently I'm developing a library that runs both on node.js and on the browser and I would like to use node.js native test runner. However, I won't be able to use it because it only runs on node.js. What alternatives have you considered?Mocha: runs on the browser and node.js, but it is not TAP compatible. Also, depends on changing global variables. |
How could |
I believe that the use of files is just to discover the tests (ex: If this test discover part is isolated, the test runner would be the same for the browser and for node.js |
@dalssoft there are other hurdles besides the file system. Just off the top of my head:
There is also a big non-technical problem: IMO people are unlikely to do the work on this module. It was mainly created so that people could use the test runner on older versions of Node. Now that those versions of EOL, there isn't a lot of activity in this repo (note the last commit was over 8 months ago at this point). |
Thanks @cjihrig for the reply. I don't know the current flow or the history of the project, but given the information I obtained today, I have some questions and some ideas. First, I believe that the From what I understand, with the correct refactoring, the current dependencies (C++, async_hooks, etc.) could be replaced by pure js and without platform dependencies. I can't see why it should be different or what advantages these dependencies bring to the project. The testing APIs appear to be simple. |
I don't think we have any reason to believe that. Node's test runner, by design, is more minimalistic than a lot of userland alternatives.
I would personally be opposed to making this change. I really dislike when Node core vendors in JavaScript projects for public facing APIs.
The APIs are simple, but there is a lot under the hood. We would definitely need a concrete plan beyond "just refactor them away." Are you volunteering? |
Sure, but it can be extended by external packages (userland). Actually that is something I'm playing with right now.
Well, but if we just extract a piece of code from node and make it work stand alone it should not be seem as a vendors lib.
That's the part I'm really clueless. Why C++, async_hooks, etc. are being used on such simple API. What are the requirements to make use of it? Is there a killer feature to justify using this technologies? Btw, last time I checked this is the introduction for
If (1) the assumptions that just pure js would make it work is correct, (2) this ideia of isomorphic test runner is valid, worth the effort and accepted by this community and (3) ideally if I have some guidance to navigate the code, I think I could take a look and contribute on this effort... |
No matter how we turn it, having two repos increases the maintenance burden, e.g setting up testing with the latest
If you're able to refactor the code so it runs on browsers and all the tests still pass, tbh that would be pretty cool, and I don't see why it would be rejected from here. I can't promise if it would make it to node core, that'll depend on what are the tradeoffs you have to make. |
Atm the package can't be consumed in browser via direct ESM/import-maps.
Is there a point in adding ESM entry?
The text was updated successfully, but these errors were encountered: