-
Notifications
You must be signed in to change notification settings - Fork 72
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
tests in TypeScript (.ts files) lack stack traces #2348
Comments
Correct
TS does generate source maps. And Node.js uses |
closes: #8662 refs: endojs/endo#2355 endojs/endo#2348 ## Description endojs/endo#2355 makes it possible to see accurate line numbers into TypeScript Ava tests run under Node, which would fix #8662 as of the next endo-release-agoric-sdk-sync cycle. To get this benefit before then, this PR turns endojs/endo#2355 into an agoric-sdk patch of endo. This PR also adds a test case to demonstrate that the fix works, and updates the `env.md` file to document the new environment variable for enabling this behavior. ### Security Considerations See Security Consideration of endojs/endo#2355 . In short, this feature sacrifices security for a better test-debug experience, which is fine for ***development only***. ### Scaling Considerations none ### Documentation Considerations See Documentation Considerations of endojs/endo#2355 ### Testing Considerations This PR effectively serves as a test both for endojs/endo#2355 and for the corresponding patch in this PR. ### Upgrade Considerations none.
See Agoric/agoric-sdk#8662
From Agoric/agoric-sdk#9700
vs
Why are we seeing this difference? Clearly, the second stack trace is more informative, and the tamed stack trace from Endo, whether 'safe' or 'unsafe', should show this more informative one. It looks like the second is relative to the source code the programmer wrote, which is ideal. But of course, the source is TS and what's executing is the JS that the TS compiles to. From the first, I'd guess that either the TS compiler is compiling into a single line of JS, or that some bundler is flattening the compiled JS into a single line of JS. But in either case, we should understand why the second stack trace is more informative. Is it based on a source map generated by the TS compiler? How does the native v8 stack get to be adjusted for that, but not the stack we're forming using the JS error API internally?
The text was updated successfully, but these errors were encountered: