jest-circus test failures#3770
Conversation
| expect.getState = () => global[GLOBAL_STATE].state; | ||
| expect.getState = getState; | ||
| expect.setState = setState; | ||
| expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors; |
There was a problem hiding this comment.
i brought in here. It used to be inside jasmine package, which i think is wrong place for it to be in, since it deals with many matcher implementation details (accessing state, formatting errors, etc.)
There was a problem hiding this comment.
@thymikee yeah! i agree for assert support, but expect.assertions is another story, since it's an expect feature and heavily coupled to matchers package
There was a problem hiding this comment.
Oh, I looked at wrong code 😅
👍
| @@ -0,0 +1,48 @@ | |||
| /** | |||
There was a problem hiding this comment.
i extracted this from jest-matchers/src/index.js
There was a problem hiding this comment.
Maybe we can call it jestMatchersObject? (btw would be nice to settle on naming convention for files)
There was a problem hiding this comment.
@thymikee that's a good name! i'll use that.
and yeah, our file naming conventions are broken :(
There was a problem hiding this comment.
Renaming them would be quite easy since we have Flow though
There was a problem hiding this comment.
renaming is not hard. agreeing on the convention is :D
i only like undercores + everything lower case (dependency_resolver.js) because:
- macOS is case insensitive, and case issues happen quite often ("works locally, breaks on CI", or "i renamed the file, but it's already added to git and git won't see my new name")
- no one knows when to capitalize filenames (is it when exporting classes? or objects? or functions?) and it's always a mess
using camel case tho saves 1 character everywhere you'd type an underscore, and it looks more like what you'd name a variable in JS.
it's definitely unrelated to the PR though :)
There was a problem hiding this comment.
Put the comment in relevant issue ;)
| * @flow | ||
| */ | ||
|
|
||
| import type {DiffOptions} from 'jest-diff/src/diffStrings'; |
There was a problem hiding this comment.
Did you run prettier on this?
5866a13 to
005140f
Compare
|
|
||
| const _addExpectedAssertionErrors = (test: TestEntry) => { | ||
| const errors = extractExpectedAssertionsErrors(); | ||
| errors.length && (test.status = 'fail'); |
There was a problem hiding this comment.
I know it is shorter, but I think it would be more readble like this, no?
if (errors.length) {
test.status = 'fail'
}There was a problem hiding this comment.
i would disagree with readability, recently i find it very hard to navigate through 100 lines functions that do just 2 things, but i agree that this line messes up semantics pretty bad by using a logical operator as an if condition :)
There was a problem hiding this comment.
Yeah, as long as we don't have pattern matching :D
| getMatchers, | ||
| getState, | ||
| setMatchers, | ||
| setState, |
There was a problem hiding this comment.
Since these are functions, not belonging to a class, wouldn't it be better to use this naming?
getMatchersStatesetMatchersState
There was a problem hiding this comment.
it's still namespaced within the matchers package though.
and with this naming the other two functions will become getMatchersMatchers then :D
thymikee
left a comment
There was a problem hiding this comment.
Looking good. Left some comments inlined.
|
|
||
| skipOnWindows.suite(); | ||
|
|
||
| const cleanupStackTrace = stderr => { |
There was a problem hiding this comment.
Can we make sure this function verifies that there is a stack trace for both and fails if one of them or both are missing? :)
There was a problem hiding this comment.
we can't run both versions yet (jasmine and circus). And this is mostly for me. when i'm done with circus this will be removed, and the error is there only to make sure i don't forget to remove it after i'm done :)
| return error.message; | ||
| } else { | ||
| return String(error); | ||
| return `${String(error)} thrown`; |
There was a problem hiding this comment.
If you are turning it into a sentence, it needs to end with a ..
There was a problem hiding this comment.
this is the way jasmine throws errors now, i just change it to this to be compatible with current snapshots
8a57c1c to
1dbfa55
Compare
1dbfa55 to
bab4eac
Compare
Codecov Report
@@ Coverage Diff @@
## master #3770 +/- ##
==========================================
- Coverage 58.09% 57.65% -0.44%
==========================================
Files 191 194 +3
Lines 6708 6773 +65
Branches 6 6
==========================================
+ Hits 3897 3905 +8
- Misses 2808 2865 +57
Partials 3 3
Continue to review full report at Codecov.
|
* jest-cirtus failure tests * jest-circus failure messages
|
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. |
addresses all failing tests in
integration_tests/__tests__/failures-test.jsassertmodule failuresexpect.assertions(555)