caxy / front-end-starter-kit

Caxy's Front End Starter Kit -- Backend: https://github.com/caxy/symfony-starter-kit --
https://www.caxy.com
MIT License
3 stars 2 forks source link

Propose testing tools and frameworks #4

Closed jschroed91 closed 7 years ago

KatieUde commented 7 years ago

General Considerations for a Test Framework:

  1. It should be fast
  2. It should easily handle asynchronous tests
  3. It should be easy to use from the command line
  4. It should allow one to use any assertion and mock library
  5. It should work in the browser for ease of debugging

The following provides some options based upon research. However, I think we ultimately will want to decide if we pick tools to use universally or if we tailor to the specific project at hand.

Option 1:

Option 2:

Option 3:

These three options are not meant to be a comprehensive listing of offerings available for use. There are many more that could be considered, but based on frameworks we typically use (angular and/or react), the ones suggested seemed to make the most sense. If we want to pick a tool to use universally, I am leaning towards the Mocha/Chai route, but there are pros and cons to each of the options I provided.

KatieUde commented 7 years ago

Mocha

Pros:

Cons:

Tape

Pros:

Jest

Pros:

jschroed91 commented 7 years ago

@KatieUde you rock!!

I am also leaning towards the mocha route (option 1).

It plays nicely with webpack I assume based on the webpack preprocess.

What is auto mocking in Jest? In curious what it is and why it's a con - auto mocking sounds like a lazy developers best friend!! ;) But seriously, I haven't heard it before so I am curious.

Waiting for hear back on Beck and Chris' feedback too - and we can determine next steps.

I'll have a PR for a basic webpack set up tomorrow... that should at least unblock us from implementing some test examples - that would be the next step - and if we're unable to pin down on one right now, then maybe we do example implementations of the same test in 2 of the 3 options (Jest is appealing to me but it sounds like it might be tough to work with off the bat, and might be biased toward React apps.

jschroed91 commented 7 years ago

Some quick research on auto mocking has made it apparent why it's listed as a con 👅

My initial vote is for Mocha based on this! I await the feedback of my peers

jschroed91 commented 7 years ago

Based on discussion in the hipchat room and elsewhere, I think we're going to go with option 1 for our first go and we'll see how it goes.