-
-
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
docs: document Node.js' --enable-source-maps flag #4173
Conversation
@bcoe thank you for this PR. We do not whitelist or document NodeJs options in our documentation. There are just a few exceptions like |
I understand 100% where you're coming from. Worth considering though, something like 60% of folks writing JavaScript these days spend at least some time writing TypeScript. Rather than just documenting this flag, it might be worth having a section of docs that speaks to making mocha work well with TypeScript:
|
I think this is worth adding. I realize that documenting node flags is a slippery slope (as @juergba wrote, there's no end to it), but I think we should take it on a case-by-case basis. It's plainly useful information, and I'd like to see more of this on the docs site. That said, we should add to the examples repo. @bcoe can you please resolve the conflict? |
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.
please address comments + resolve conflicts
@boneskull 👍 will try to get this done ASAP. |
b042a0e
to
4739f0f
Compare
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.
It is under COMMAND-LINE USAGE now.
How about we document it under ABOUT node FLAGS because it is a node flag not mocha flag.
@bcoe The build is failing because there's an incorrect anchor link. Also, @outsideris had a request |
1315101
to
edb8e6b
Compare
@boneskull 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.
Thank you.
Description of the Change
Newer versions of Node.js introduce the
--enable-source-maps
flag which, when enabled, caches source-maps and provides accurate stack traces to users running transpiled code, e.g., TypeScript.Benefits
Many users of Node.js are writing TypeScript, this allows them to receive better stack traces in mocha without installing any dependencies.
Drawbacks
There's still work to be done to polish this feature in Node.js (would very much appreciate getting feedback).