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

Refactor runner #3166

Merged
merged 8 commits into from
Mar 17, 2017
Merged

Refactor runner #3166

merged 8 commits into from
Mar 17, 2017

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented Mar 17, 2017

Summary
This is the preparatory work I did for the multi-config runner. It splits up the test performance cache into a TestSequencer class, uses async/await and moves a few things around. No behavior changes expected. Before merging, I will add a test for the TestSequencer.

See #3156

Test plan
jest

Copy link
Contributor

@rogeliog rogeliog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup

const timing = cache[filePath] && cache[filePath][1];
if (timing) {
timings.push(timing);
tests.forEach(test => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit, but I think we can change this for

const timings = tests.map(test => test.duration).filter(duration => !!duration)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you are bringing this up! I actually can't simplify because flow isn't smart enough to realize that the filter call filters out falsy values. It types timings as Array<?number> instead of Array<number> :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, that is interesting

@cpojer cpojer merged commit d7491b4 into jestjs:master Mar 17, 2017
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
* Improve runJest by breaking up the promise chain into functions.

* Use async/await.

* Add a TestSequencer and “Test” type to clarify responsibilities and improve type interfaces.

* async/await in runTests.

* Minor cleanups

* Fix the test.

* Move `runCLI` into the cli folder.

* Updates to TestSequencer + test the code.
@cpojer cpojer deleted the refactor-runner branch May 4, 2017 15:44
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Improve runJest by breaking up the promise chain into functions.

* Use async/await.

* Add a TestSequencer and “Test” type to clarify responsibilities and improve type interfaces.

* async/await in runTests.

* Minor cleanups

* Fix the test.

* Move `runCLI` into the cli folder.

* Updates to TestSequencer + test the code.
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants