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

Jest jasmine/ts migration #7970

Merged
merged 36 commits into from Mar 5, 2019
Merged

Jest jasmine/ts migration #7970

merged 36 commits into from Mar 5, 2019

Conversation

doniyor2109
Copy link
Contributor

Summary

Migration to TS

Test plan

@SimenB
Copy link
Member

SimenB commented Feb 24, 2019

Heh, 295 errors 😅 Could you ping me when this is getting more ready for review (or if you have any questions)?

@doniyor2109
Copy link
Contributor Author

@SimenB Haha. It is not ready yet. I just wanted to try Draf PR 😄 . I will ping when it is ready

@SimenB
Copy link
Member

SimenB commented Feb 24, 2019

BTW, I wouldn't worry too much about typing src/jasmine - it's a fork from jasmine itself and at some point we'll remove it in favor of jest-circus anyways. If it's not too painful, of course go for it 🙂

@SimenB
Copy link
Member

SimenB commented Mar 3, 2019

@doniyor2109 since you commited TS migration part (final), is this ready for review? 🙂 I merged in master since I tweaked a few types here and there in #7998

@doniyor2109
Copy link
Contributor Author

@SimenB Yea, it took too long for this migration. I just finished types. However tests are failing because of wired error. Somehow babel does not transpile static fields and property fields correctly. 🤔

}
if (currentDeclarationSuite.markedTodo) {
// @ts-ignore TODO Possible error: Suite does not have todo method
suite.todo();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

todo does not exists on Suite. It might be error. I just ignored for now

if (error instanceof AssertionError) {
checkIsError = false;
// @ts-ignore TODO Possible error: j$.Spec does not have expand property
message = assertionErrorMessage(error, {expand: j$.Spec.expand});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also might be error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However tests are passing

Copy link
Member

Choose a reason for hiding this comment

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

Since the tests are passing, I wouldn't worry too much about it

@@ -6,8 +6,6 @@
*
*/

'use strict';

describe('iterators', () => {
Copy link
Member

Choose a reason for hiding this comment

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

These tests looks like they belong in expect, don't they?

/cc @pedrottimark

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I will make sure that expect covers these test cases.

@@ -6,8 +6,6 @@
*
*/

'use strict';

describe('matchers', () => {
Copy link
Member

Choose a reason for hiding this comment

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

same here - seems like they should be in expect

Copy link
Contributor

Choose a reason for hiding this comment

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

This one might be needed?

describe('matchers', () => {
  it('proxies matchers to expect', () => {
    expect(() => expect(1).toBe(2)).toThrowErrorMatchingSnapshot();
  });
});

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but it doesn't test anything jasmine? I don't understand what it means by "proxies to expect" - it uses expect directly

Copy link
Contributor

Choose a reason for hiding this comment

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

In other words, Jest test suite is integration test that expect works in jasmine.

Copy link
Member

Choose a reason for hiding this comment

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

Right - if expect didn't work in jasmine, the whole test suite would fail. The advantage of using Jest to test Jest 🙂

@rubennorte
Copy link
Contributor

This is huge and I just took a quick look. I'll trust @SimenB here. We can merge it, release an alpha and test it in FB code. If everything is good we can just release a new minor after the full TS migration.

Please take into account that jest-circus will be the default in the next major, so Jasmine won't be that critical at that point.

@SimenB SimenB merged commit 7a4ee21 into jestjs:master Mar 5, 2019
@rubennorte
Copy link
Contributor

Thanks for the huge contribution @doniyor2109!!

@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 11, 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.

None yet

6 participants