-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Stop hiding source of syntax errors #325
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
Conversation
test/fork.js
Outdated
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.
Are you talking about this test here? If this test passes, that seems fine to me. We are getting a failure. Users of the CLI or API will get "can't find any files to test", like they have. Anybody using lib/fork from outside AVA is already asking for trouble.
We need to investigate why it fails on Node 0.10.
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.
We need to investigate why it fails on Node 0.10
It seems to fail in the regex test for the error message, so maybe the error message changed from 0.10 to others. I can give it a try with nvm.
If this test passes, that seems fine to me.
Yep it works and passes but I was just curious about the fact that a stack is printed to the screen during that error. Maybe it's not a big deal.
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.
That is because we have to let Node print it to stderr natively. We could clean up the output of our own tests by allowing fork to take stdio options like child_process.fork does (and pipe them to something else besides stderr for that particular test). That's a future PR, IMO.
Yep, that is anticipated. Basically due to some V8 issues, it is impossible to extract the filename and/or line number from caught SyntaxErrors in JavaScript. Node includes a hack that will print that information to stderr, but it relies on native C++ code. This is why we are changing the position of where we start listening for |
|
Sounds good! Seems like my suspicion was right. Node 0.10 gives an error code of 8 on no file fount, while other Node versions give an error code of 0, which is why my test was failing. It's a quick regex change luckily. |
test/api.js
Outdated
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.
use taps t.match(string, regexp) in all new tests. It gives us better error messages. See #256
test/cli.js
Outdated
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.
t.match
|
looks like you missed 1 |
|
|
It looks like it was 1 - that's good. As long as it is non-zero. |
|
Yeah sorry I mistyped. Well either way I got that fixed. The AppVeyor builds all passed—not sure why the check isn't there yet. |
|
AppVeyor takes about 20 minutes per commit to complete, you pushed a few commits in rapid succession, so it was way behind. I cancelled all of them. Go ahead and fix that last |
|
LGTM |
|
Thanks @sotojuan! |
|
I was playing around with/learning about syncing forks and accidentally pushed, so I guess I'll need your LGTM back @jamestalmage. Sorry about that I'm gonna go ahead and fix some inconsistencies in my tests (I think |
|
LGTM |
|
Great work @sotojuan :) 🍰 |

This helps out with #308. It does the following things:
However, there's one issue. The
fork.jstest that calls a nonexistent file ("rejects on error and streams output") doesn't seem to get a "file does not exist error" (it just gets "error code 1 returned") and worse, a stack of it shows up in the test results. The testing continues fine though, but I am not sure how to contain it or test it.Originally the test had an
.on('uncaughtException')clause but after making thebabel.jschanges, it is not called at all so I removed it.Any suggestions and help is appreciated!