Skip to content

Instantly share code, notes, and snippets.

@stefanpenner
Created November 24, 2013 06:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanpenner/67d2b6efba50969f4efc to your computer and use it in GitHub Desktop.
Save stefanpenner/67d2b6efba50969f4efc to your computer and use it in GitHub Desktop.
1. Littering a functioning app with Ember.run in order to test it seems weird, imagine needing to add Rails.run to controllers and models for no other reason than "you can't test it without this".
resolution:
1. some low hanging fruit, implement
- Ember.ajax
- Ember.getJSON
2. more material on the run-loop
- general run-loop knowledge
- cargo-cult mode for async copy+paste examples (animations, websockets, postMessage, MessageChannel, ...all the async...)
2. Unit testing involves having a running App (weird, but that's fine) and then plucking the units off of it, I am told `App.__container__.lookup` is a no-no. What else am I supposed to do?
resolution:
1. lookupFactory or similar helper
2. transition people to use modules
- eventually we need to migrate docs/guides
- upgrade path
- 2 resolvers
- 1 strict, future resolver
- 1 modify the current resolver to work with new conventions
- work with slashes not as namespaces
3. Some people use imperative code to create instances of objects and test them. How does this work with a component that has a relationship with another component that is established via markup? `{{#x-menu}} {{#x-menu-item}}foo{{/x-menu-item}} {{/x-menu}}`. I personally just have a running app with a template and pull them off the app, is this correct? (ie https://github.com/instructure/ic-menu/tree/master/test)
resolution:
- test harness helpers ?
- guides and cookbook additions?
4. When something goes wrong you end up in either a terrible promise stack trace or backburner stack trace. At the point you have no clue what is wrong and have nothing to help you out. What adds to the frustration is that the app works fine. I feel like I should be able to use sinon to fake the timers instead of having ember turn off autorun.
resolution:
- improve promise debugging via labels/inspection -> ember-inspector
- add long stack trace support to RSVP
- global ENV.LONG_STACK_TRACES work with both RSVP and backburner
- somehow stitch these together to provide better context, seems like a thing that needs much love (consider how Bluebird does this https://github.com/petkaantonov/bluebird).
- Add timeouts to andThen (to avoid mysterious hanging tests)
5. Need clear explanation of why things like `visit` and `click` in ember-testing need to exist and how they are implemented. `click` is not the only interaction, good tests for UI will include scrolling, drag/drop, mousedown, mouseup, hover, etc. etc. I use `jquery.simulate` for all of these things. I can dig through the source of ember-testing's `click` to mimick it but that's not a good story or experience.
resolution:
- trigger helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment