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

Use jest-matchers for assertions instead of expect #468

Merged
merged 2 commits into from
Sep 15, 2017

Conversation

skovhus
Copy link
Contributor

@skovhus skovhus commented Apr 24, 2017

Currently expect@1.x is being integrated into Jest (see more background in jestjs/jest#1679).

In jest-codemods I'm working on a codemod to automate the process of going from mjackson/expect to jest-matchers (if running in a browser) or plain Jest (if running in node). 🤖

I've tested the codemod on this project and everything should still work.

Let me know what you think.

Update

Updated 4th Septhember with Expect@21

@mjackson
Copy link
Member

Hey @skovhus, thanks for taking a look at this. Do you have any updates here? I'd like to make this upgrade happen sometime soon. Thanks! :)

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

@mjackson would you like to still use a browser for executing these tests? If so then I can wrap this PR up using jest-codemods, so you can use the jest-matchers. At one point the jest-matchers package will be renamed to expect, but that should be a small change at that point. : )

@skovhus skovhus force-pushed the use-jest branch 2 times, most recently from e97509b to 976469e Compare July 19, 2017 13:38
@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

@mjackson I've just reran the codemod on latest master.

If you want to keep running the tests in a browser, there are still some issues with the es5 bundle of jest-matchers. Seems to be something related to IE10.

Let me know which testing environment you would like, node or browser. : )

19 07 2017 13:42:43.316:INFO [IE 10.0.0 (Windows 8 0.0.0)]: Connected on socket -C3IcIu9DHLMDYfIAAAE with id 90097551
IE 10.0.0 (Windows 8 0.0.0) ERROR
  Object expected
  at webpack:///~/jest-matchers/build-es5/index.js:4994:0 <- tests.webpack.js:5330
IE 10.0.0 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0.417 secs / 0 secs)

@mjackson
Copy link
Member

Thanks, @skovhus. I need to keep using the browser for these tests because part of this library's job is to work around bugs and/or slightly differing behavior in various browser implementations, so the in-browser tests are crucial. I'd also like to make sure the ES5 build of the next version of expect works well in browsers. The current version of the package works well in browsers, and we need to preserve that if we want to provide a smooth upgrade path.

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

@mjackson I totally agree with the browser support for next version of expect/jest-matchers. 👍🏻 So while working on the codemod, I've also been contributing browser support to Jest:

We are just missing a few things it seems. : )

@skovhus
Copy link
Contributor Author

skovhus commented Aug 27, 2017

I'll update this once jestjs/jest#4367 has landed.

@skovhus
Copy link
Contributor Author

skovhus commented Sep 4, 2017

@mjackson master has been merged in now that expect@21 has been released. Should be ready for you to merge. : )

@mjackson
Copy link
Member

Thanks @skovhus! I'm taking a look at this now.

@mjackson mjackson merged commit 0a52c4b into remix-run:master Sep 15, 2017
@skovhus skovhus deleted the use-jest branch September 15, 2017 05:27
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants