-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[WIP] json output from runTests #4235
Conversation
[Symbol.asyncIterator](): AsyncIterableIterator<RunTestsMessage> { | ||
return this; | ||
} |
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.
Can we use an async generator instead of a next()
method?
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.
I'm open to that, is there an advantage doing that?
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.
Then no ugly next()
method is exposed. I've been meaning to get rid of the one in Listener
.
Just realised this class is private, though. Who cares.
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.
Still should be consistent... would rather have async generator methods. I don't know if it empowers V8 to optimise stuff behind the scenes or not, but it could. If you implement the shape of a generator, it may limit V8s ability to optimise.
647e373
to
04cd048
Compare
1943884
to
7524e5d
Compare
Closing in favor of #4336 |
Trying to implement JSON output from
runTests
and use it incli/js/unit_test_runner.ts
.At the moment
unit_test_runner.ts
parses text output fromrunTests()
; so parsing JSON seems like a more robust solution than using RegExps. There are, however, some quirks that it needs to account for; eg.await Deno.stdout.write()
will still be visible in output so consumer need to account for that fact.Ref #4166
CC @kitsonk