-
-
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
Use property initializer syntax in Jest codebase #7881
Conversation
I think something's wrong with my yarn since I got such a long UPD Updated to the latest yarn version which doesn't strip integrity fields. |
b2f3946
to
39e453d
Compare
I don't have Instead, I see 1 test fails locally in the branch but passes in master, it's about error message in |
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.
thanks!
regarding test failures, you've done yarn build
after your changes?
|
||
enter( | ||
onChange: (pattern: string, options: ScrollOptions) => void, | ||
onSuccess: () => void, | ||
onCancel: () => void, | ||
) { | ||
this._entering = true; |
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.
these should be kept, since we need to reset the values in enter
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.
Moved to _resetState
function → 68ce8b4
and added a test for that.
I changed this code and nothing didn't tell me that I can't, seems like "a lack of coverage", doesn't it? WDYT?
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.
yeah, probably need to expand an e2e test to activate a plugin, type something, go out of the plugin, go back in, then assert that the prompt is empty
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.
So, do you think it should be an e2e test? (I've added a unit one, probably doesn't make sense then)
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.
I guess it's better to address separately.
39e453d
to
68ce8b4
Compare
Nice catch :-) I run it this way now:
Everything's okay except the one test:
Don't know why it's happening so far but need to figure out, if I check out on master everything's okay. |
And it's not even e2e test, so "building" doesn't make any difference. |
Oh, man, you're right. I just didn't wait until all the tests finish 😱 I'm getting the same results as in CI now. My bad. |
super(options); | ||
this.isInternal = true; | ||
} | ||
isInternal: true = true; |
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 be boolean instead of true, here and in other places
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.
In here it's fine, I'd say. It can never be false
, thus true
is just stricter. The parent class (BaseWatchPlugin
) needs to be boolean
, though
After adding `@babel/plugin-proposal-class-properties' the `error` to string coercions start to give a different message: ``` AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: error.toString() ``` It's weird since we can add `console.log` inside the custom console `assert` method and the correct message gets back. In case of autogenerated message, let's specify the exact one since we have all the data within error object for that.
0965bc0
to
2d72c60
Compare
@@ -25,7 +25,6 @@ class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin { | |||
super(options); | |||
this._failedSnapshotTestAssertions = []; |
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.
this as well?
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.
You can move all of these to properties, even new SnapshotInteractiveMode(this._stdout);
.
This 2d72c60 concerns me the most. TBH, I don't get the root cause. |
Gosh, there's no 2 days in a row without getting conflicting files 😃 |
I think it's better to split this PR marking more incremental changes, I believe the codebase's changing due to migration to TS and that's why there's a lot of conflicts. |
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. |
Summary
This PR addresses #7846