Common-voice: Introduce automated tests?

Created on 2 Oct 2017  路  8Comments  路  Source: mozilla/common-voice

There currently appear to be no automated tests in the backend nor the frontend part of CV.

Should we work to introduce them?

Or is this a deliberate decision?

Most helpful comment

I prefer Jest too. I'll probably pick a simple component like Modal or Alert and put a PR together to make sure what I have in mind gels with the project.

All 8 comments

Yes please! This was not a decision, just lack of bandwidth. Now is definitely the time to start discussing these things.

that's great to hear!

do you have any experience/preference in terms of testing frameworks/libraries and assertion libraries? (personally, I have some experience with Jasmine, karma, mocha, and chai)

Edit: Also, here's a comparison article for convenience :) https://raygun.com/blog/javascript-unit-testing-frameworks/

To chime in, I have experience at work to write unit test using Jest (+ enzyme for rendering React components for testing)

Most of my testing experience is with mocha, chai, and sinon. I'm not married to any toolkit though.

Here are some test suites we need:

  1. Test main server api calls (run the server, load web/src/lib/api.ts in a unit testing framework)
  2. Test that index.html can be loaded
  3. Test all the gulp commands

I've got a lot of experience with building React components TDD, in both Mocha and Jest, and would love to help. There doesn't seem to have been any UI tests written yet - I'd be happy to help if this is still a priority?

Happy to hear that, it is still something we very much want. I personally prefer Jest, as it imo has a better ouf of the box experience. Do you have a preference @itsravenous? And is there already a/some components you have in mind for testing?

I prefer Jest too. I'll probably pick a simple component like Modal or Alert and put a PR together to make sure what I have in mind gels with the project.

We now have a place to start with the tests using Jest. I'm going to close this for now, and we can open individual bugs for new tests and enhancements to the framework.

Was this page helpful?
0 / 5 - 0 ratings