Skip to content

Instantly share code, notes, and snippets.

@machty machty/journal.md
Created Jun 18, 2018

Embed
What would you like to do?
ember-testing journal

Ember Testing Journal

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.

Figuring out how to stub a service in an acceptance test

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 that moduleForAcceptance has been replaced by another paradigm where you just use module and test. 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 of import { 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.