We've been driving all of our Ember tests with end-to-end Capybara tests running from our Rails server for some time. There are many upsides to this approach, but Capybara tests are generally slow and brittle, so we'd likely to start investing in client-side only Ember tests that don't actually hit the server at all.
Given that I don't have a lot of experience with Ember tests, I wanted to keep a journal of first impressions and snags I encountered along the way, so that perhaps this information will be useful for documentation maintainers or whomever.
Screencast of me talking through my through process
Takeaways:
- Google SEO is not great
- StackOverflow answer is old and distracting; I have to leverage a lot of Ember experience and spidersense to determine that suggested answers are wrong / no longer relevant
- There's a 2017 blog post the references
moduleForAcceptance
, and even though I know ember-testing has been through a lot of changes lately, 1. not everyone knows that and 2. even I can't remember what actually changed, and it takes some sleuthing to figure out thatmoduleForAcceptance
has been replaced by another paradigm where you just usemodule
andtest
. It DOES help that the 2.x docs that google linked me to shows a link at the top that warns me that the docs are out of date, but it's a bit disorienting to temporally navigate the ember-testing APIs as they've changed over time and even when I move to the latest docs it's hard to feel confident that the particular combination ofimport { test, module, moduleForOldAssApiAcceptance }
I see on the docs is correct or up-to-date (just sharing my feeling; these snags are probably very "me"-specific) - I didn't mention this in the video, but I only found "Stubbing Services" on the Testing Components page because I remembered something about how at one point you could only stub services for components. I opened an issue to move "Stubbing Services" to its own top-level page.