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 Support #781

Closed
skellock opened this issue Feb 28, 2017 · 10 comments
Closed

Jest Support #781

skellock opened this issue Feb 28, 2017 · 10 comments

Comments

@skellock
Copy link
Contributor

Jest looks to be the chosen one now. It ships with React Native.

My ❤️ is still with AVA, but out-of-the-box is a pretty friggin compelling argument.

Is this a plugin? An option? Does this belong in the infinite-red stack? How to we get ignite plugin authors to support both? Way too many questions.

At the sound of the tone... please leave your opinion below.

beep.

@skellock skellock added this to the Someday milestone Feb 28, 2017
@jamonholmgren
Copy link
Member

jamonholmgren commented Feb 28, 2017

I think we should switch to Jest purely because it's out-of-the-box and a pretty good system, even if Ava is better overall. Standard is better than better in this case.

EDIT: Now that I've used both a little more...I'm not so sure. Ava is awesome, Jest is okay.

@skellock
Copy link
Contributor Author

skellock commented Mar 5, 2017

My case is really simple and superficial.

I used jest before it got rewritten. It was horrible. And I wasted days on it. Now that it's better, I still cringe despite it not being the same codebase.

AVA has never stopped being awesome. And simple. It was awesome day 1 and with 18 is even better. The assertions are simple. And I don't think about tests when when I'm writing with it. I'm thinking about my code.

I vote we stay team AVA in our boilerplate and if people want Jest, it's not a huge departure for them to use it. Spork it... or if you really feel strongly, create a new boilerplate.

@juddey
Copy link
Contributor

juddey commented Mar 5, 2017

I was thinking about making a jestthing for this with 2.0. Idea being you could choose to nuke ava and replace it with jest if you wanted. The plugin (??) would also convert the default tests to jest format.

We have had a few people come in to the channel and ask 'what about jest?'... Then I launch into this explanation about how jest can be used and installed with ignite and its really just a test runner, and etc, etc. Really love to be able to say just ignite add ignite-jest-thing and that'll replace ava with jest.

I am using jest in my project and am so far happy with it (maybe a day will come when I am not happy, but I will cross that bridge when I come to it) 🌉

This way, I think we keep everyone happy. Thoughts?

@GantMan
Copy link
Member

GantMan commented Mar 6, 2017

I will happily write a JEST plugin at some point. Hold me to that.

First I'll have to move AVA to a plugin... I would LOVE for anyone to do that before me.

@jamonholmgren
Copy link
Member

jamonholmgren commented Mar 8, 2017

@GantMan This merits a larger discussion, but generally speaking, I don't think larger, cross-cutting things like testing should be in plugins. Too many separate things will generate tests, and writing all of them to generate the right kind of tests based on what plugins are installed will get problematic to both build and test adequately. If you use a Jest-powered boilerplate, use Jest. If you use an Ava-powered boilerplate, use Ava. We can fork boilerplates quickly to support each and they can diverge as necessary. My 2 cents. :)

@javiercr
Copy link
Contributor

javiercr commented Mar 14, 2017

Because of the problems described in #691 with AVA, I'm giving a try to Jest and so far I'm loving it. Mainly for two reasons: speed and better integration & docs for RN.

The main problem I had when using AVA is that many RN packages do not pre-compile code before publishing. To make it work I had to do some hacking with babel-register.

This problem does exist in Jest too. However when I went to Jest docs for RN I found this:

image

The fact they were explaining this problem in plain English right in their docs made my fall in love with Jest :)

@skellock skellock modified the milestone: Someday Mar 16, 2017
@jamonholmgren
Copy link
Member

@GantMan Do you still intend to write this plugin? I think you and Steve convinced me this was a good idea offline.

@skellock
Copy link
Contributor Author

I think this is a boilerplate issue. Jest is installed by default. Our boilerplate skips jest during the react native install. If someone makes their own boilerplate, they get jest for free.

Im onboard with us switching to jest even though my preference is for ava. It is the path of least resistance and certainly the popular choice these days.

@kevinvangelder
Copy link
Member

I agree with @GantMan, Ava and Jest should both be optional plugins. @jamonholmgren's point about tests in other plugins is problematic regardless if we make tests a boilerplate or plugin concern.

@jamonholmgren
Copy link
Member

Resolved in infinitered/ignite-andross#30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants