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

Switch to jest for unit testing? #691

Closed
lgeiger opened this issue Apr 2, 2017 · 1 comment · Fixed by #713
Closed

Switch to jest for unit testing? #691

lgeiger opened this issue Apr 2, 2017 · 1 comment · Fixed by #713
Labels
discussion 💬 Discussion is wanted

Comments

@lgeiger
Copy link
Member

lgeiger commented Apr 2, 2017

Atom's test runner uses Jasmine 1.3 which was released in 2012. Unfortunately they can't upgrade this easily since they would break all community packages.

With nteract slowly switching to jest, I think we should evaluate if switching to jest makes sense for Hydrogen too. I recently saw that prettier-atom also uses jest for testing despite beeing a Atom package. That's what got me thinking about using it as well.

Here are what I think are the Pros and Cons of jest for our use case:

Pros Cons
far superior mocking capabilities we would lose access to the atom global and can't use require('atom') (unless one writes a Atom test runner, which seams a bit flaky) so we definitely need those mocking capabilities
better support for async tests more dependencies and initial setup, e.g. we need to set up babel for transpiling the tests
more features like snapshots, coverage, test watching, ... devs need Node and npm installed
new and shiny (very subjective, only "real" benefit: devs may end up writing more tests) no graphical UI for beginners

prettier-atom also has a custom babel transpile step, but I don't really see the benefit compared to our current setup, especially since we would need to check in the generated files due to apms packaging system (atom/apm#498)

Just putting this out there since jest seams pretty cool but I haven't used it much so I wonder if we would benefit from it despite loosing access to Atom's API.

What do you think?

@lgeiger lgeiger added the discussion 💬 Discussion is wanted label Apr 2, 2017
@BenRussert
Copy link
Member

Do you know of any other Atom packages using jest? Either way I was thinking it might be good to see if we could get a discussion started on the atom forums.

Maybe others have tried or have some input on the pros and cons. If we would be "pioneering" this there might be some good feedback on challenges we might face.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion 💬 Discussion is wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants