Skip to content
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

Closed
wants to merge 10 commits into from

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Mar 3, 2020

Trying to implement JSON output from runTests and use it in cli/js/unit_test_runner.ts.

At the moment unit_test_runner.ts parses text output from runTests(); 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

Comment on lines +246 to +257
[Symbol.asyncIterator](): AsyncIterableIterator<RunTestsMessage> {
return this;
}
Copy link
Collaborator

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?

Copy link
Member Author

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?

Copy link
Collaborator

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.

Copy link
Contributor

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.

@bartlomieju
Copy link
Member Author

Closing in favor of #4336

@bartlomieju bartlomieju deleted the run_tests_iterator branch March 13, 2020 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants