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

Pass “Test”s to reporters; update Test to contain contexts. #3289

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented Apr 12, 2017

Summary
Pulling out commit #2 from #3156 to make the other diff easier to review as I add more stuff on top of it. This is changing how reporters work a little bit but there may be some more changes later.

cc @abdulhannanali

Test plan
jest

@codecov-io
Copy link

codecov-io commented Apr 12, 2017

Codecov Report

Merging #3289 into master will decrease coverage by <.01%.
The diff coverage is 42.1%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3289      +/-   ##
==========================================
- Coverage   63.89%   63.89%   -0.01%     
==========================================
  Files         176      176              
  Lines        6473     6472       -1     
  Branches        4        4              
==========================================
- Hits         4136     4135       -1     
  Misses       2336     2336              
  Partials        1        1
Impacted Files Coverage Δ
...ackages/jest-cli/src/reporters/CoverageReporter.js 61.97% <ø> (ø) ⬆️
packages/jest-cli/src/reporters/BaseReporter.js 66.66% <ø> (ø) ⬆️
packages/jest-cli/src/reporters/DefaultReporter.js 16.39% <0%> (ø) ⬆️
packages/jest-cli/src/runJest.js 0% <0%> (ø) ⬆️
packages/jest-cli/src/reporters/VerboseReporter.js 30.61% <0%> (ø) ⬆️
packages/jest-cli/src/TestSequencer.js 100% <100%> (ø) ⬆️
packages/jest-cli/src/TestRunner.js 32.93% <37.5%> (-0.4%) ⬇️
packages/jest-cli/src/TestPathPatternPrompt.js 98% <0%> (-0.04%) ⬇️
packages/jest-cli/src/TestNamePatternPrompt.js 94.33% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77ce9ec...5108bc3. Read the comment docs.

@@ -228,17 +232,17 @@ class TestRunner {

// Send test suites to workers continuously instead of all at once to track
// the start time of individual tests.
const runTestInWorker = ({config, path}) =>
const runTestInWorker = test =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

const runTestInWorker = (test: Test) =>

Copy link
Member Author

Choose a reason for hiding this comment

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

Flow isn't asking me to annotate this which means it infers the proper type. Why should I change it? I don't want to add superfluous types.

@@ -439,14 +443,13 @@ class ReporterDispatcher {
);
}

onTestResult(config, testResult, results) {
onTestResult(test, testResult, results) {
Copy link
Collaborator

@thymikee thymikee Apr 12, 2017

Choose a reason for hiding this comment

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

Types

onTestResult (test: Test, testResult: TestResult, results: AggregatedResult)

Copy link
Member Author

Choose a reason for hiding this comment

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

Same, Flow isn't asking for it. Is this about readability? If Flow isn't asking it means the type isn't ambiguous to flow.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, sorry about that, I'm checking it through GH, so I don't know if Flow infers something :D

constructor(config: Config) {
this._config = config;
constructor(context: Context) {
this._context = context;
this._cache = {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be nice to type perf cache too

@@ -84,11 +84,13 @@ const runJest = async (

if (
data.paths.length === 1 &&
config.silent !== true &&
config.verbose !== false
hasteContext.config.silent !== true &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be renamed to context for consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is happening somewhere in the larger PR, yes. It creates more merge conflicts if I do it in this one.

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Looks good

@cpojer cpojer merged commit 6517c7b into jestjs:master Apr 12, 2017
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
@cpojer cpojer deleted the test-reporters branch May 4, 2017 15:44
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@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.

4 participants