-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Implement numPassingAsserts
of testCaseResult
#13795
Changes from 23 commits
f442c15
edefeab
4173948
590003b
559c28f
a8e0584
9ecbb59
d4f62c0
a423029
cdfd96f
ba550ce
82e450f
0418a30
94386e1
249388c
8e13c11
e5408ae
2aa739f
886a709
bae470a
607bdb3
309f98d
d683aaf
e920161
7f2f2df
9d0c78a
f3dff25
e5cac79
565fef8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
class AssertionCountsReporter { | ||
onTestFileResult(test, testResult, aggregatedResult) { | ||
testResult.testResults.forEach((testCaseResult, index) => { | ||
console.log( | ||
`onTestFileResult testCaseResult ${index}: ${testCaseResult.title}, ` + | ||
`status: ${testCaseResult.status}, ` + | ||
`numExpectations: ${testCaseResult.numPassingAsserts}`, | ||
); | ||
}); | ||
} | ||
onTestCaseResult(test, testCaseResult) { | ||
console.log( | ||
`onTestCaseResult: ${testCaseResult.title}, ` + | ||
`status: ${testCaseResult.status}, ` + | ||
`numExpectations: ${testCaseResult.numPassingAsserts}`, | ||
); | ||
} | ||
} | ||
|
||
module.exports = AssertionCountsReporter; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,9 @@ export function onNodeVersions( | |
}); | ||
} | ||
} | ||
|
||
export function skipTestOnJasmine(testBody: () => void): void { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is a new helper needed? shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if (!isJestJasmineRun()) { | ||
testBody(); | ||
} | ||
} |
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.
should we reset it?
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.
numPassingAsserts
is reset to 0 after execution of_addExpectedAssertionErrors
, reset method is called withinjestExpect.extractExpectedAssertionsErrors
method.https://github.com/facebook/jest/blob/d683aafde24f2cf6f6cb5a0a71069fd6a0a55c36/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts#L249-L253