mintable
mintable copied to clipboard
Add a test suite
As part of #43, it came up that a unit test suite would be a good addition. In this thread, we could discuss what that might look like technology-wise.
Items to discuss:
-
Where it builds It looks like Travis-CI is what's required on branch and PR builds, so likely that should also run the test suite.
-
Tech stack I have the most experience with Mocha and Chai but, since this project uses React, something like Jest might be preferable to the other maintainers?
-
Unit / Integration / Functional Tests We could easily start off with just unit tests, adding in additional test suites later like component (integration) tests or functional test (e.g. Cypress).
While I'm in favor of adding these on a high level, want to call 2 things out:
- I think this will be quite a large endeavor and I'm not sure I'll personally have the time to add it for a while
- I think we should focus on testing the core back-end functions (such as interfacing with transactions & spreadsheets) rather than the front-end config framework, as I've gotten a lot of reports that the current GUI is kind of buggy and we might scrap it soon for something else.
Keeping those in mind I think this is a great idea and would welcome contributions.
We don't use react anywhere but in the front end so if there's another suite that the community is more familiar with, let's use that.
Absolutely - my intention was not to ask you to write a whole test suite. I was mostly trying to gauge what framework might be ideal for testing so we could start introducing some tests as we go along. With #48, I agree that maybe we don't test the front-end logic right away.
I'm most familiar with Mocha and Chai, but I feel like that might date me. From what I can tell on the internets, Jest is what a lot of people are using nowadays.
I'd say Jest or Mocha are both pretty popular still, and we'd be fine using either. Jest has the backing of Facebook, so it gets the nod from React a lot, but either works just fine. If you know Mocha, go with what you know. I'm sure it can handle what we need.
Hey @blimmer / @bennett39 – just wanted to highlight that we've added some non-exhaustive smoke testing pending the v2.0.0
release (see #55). You can check them out on the project's GitHub Actions page.
Right now we have two workflows:
-
test
: Tests whether all the code compiles and matches linter/formatter specs -
fetch
: Tests whether the newmintable
CLI can successfully fetch a dummy Plaid account and update a public Google Spreadsheet template without error
We require both of these to pass before merging a PR.
For now I'll mark this issue as help wanted
but I won't have the time to tackle a proper test suite in the short term.