#Resources for Writing Tests in Ember.JS
##Screencasts
- An Introduction to Ember.js
- 12th May 2015 • Beginner • Jamie White
- setting up testing on new Ember CLI project
- using Phantom JS
- mocking services and using Firebase with MockFirebase
##Slideshows
- Testing Ember Apps: Managing Dependency
- 29th August 2015 • Advanced • Mixonic
- isolating implementation & normalize behaviour
- extract as service and use promise for consistent sync/async behaviour
- has an accompanying blogpost with more details
- slideshow (not too detailed)
##Blog Posts
- Ember QUnit 0.2.x
- 6th February 2015 • Beginner • Robert Jackson
- simple examples
- this.append() is now this.subject()
- setup/teardown is now beforeEach/afterEach
- Acceptance testing in Ember-CLI, an introduction.
- 2nd May 2015 • Beginner • Mario Gintili
- basic acceptance test use case run through
- stubbing requests with Pretender & Ember-CLI-Mirage
- Improving Ember-CLI Testing with Sinon.js
- 18th May 2015 • Intermediate • John Fisher @ Atomic Object
- how to use Sinon library with Ember-sinon
- example demonstrating stubbing and checking actions
- Demystifying Asncy testing
- Mocking Ember Services for Unit Testing
- 17th April 2015 • Intermediate • Steven Edouard
- mocking Azure storage
- custom adapters
- unit testing mocked services
- Ember component integration tests
- 20th June 2015 • Intermediate •
http://alisdair.mcdiarmid.org/2015/06/20/ember-component-integration-tests.html http://matteodepalo.github.io/blog/2014/01/03/ember-integration-testing-with-konacha/ http://emberup.co/integration-tests-for-components/
##Forum Posts
- Proper way to handler timers w/ Ember Testing
- some options for Ember.run.later issue but no real conclusion
- proposed solution on Stack Overflow by Teddy Zeenny
- Manually overriding the testing run loop to wait for something
- a very basic way of pausing the test for a fixed time to allow for a non-promise event to occur
- Registering Asnyc Helpers
- create an Async Helper to wait for a specified promise to resolve Luke Melia
##Libraries
- ember-cli-htmlbars-inline-precompile
- by Clemens Müller
- precompile inline HTMLBars templates via ES6 tagged template strings
- addon to help make component integration tests readable see
- ember-qunit
- by Robert Jackson
- unit test helpers for Ember
- ember-simple-auth-testing
- by marcoow
- 3 test helpers for authenticating / setting the current session / invalidating when using Ember Simple Auth
##Forthcoming Features
Keep an eye on these for newer techniques when wrtiting tests
###Using new wait format for async testing
##Github repos with good testing examples
- LG Front-End
- Ember Jobs
- stubbing resolver
- simple stubbing of requests using Pretender
- Ember Inspector
- Ember Crumbly
- acceptance testing formatting
- Ember Front End Blog
- acceptance testing with Pretender
- Liquid Fire
- working with view registry (last resort, better to test visible interfaces)
- Ember Long Polling With Testing Example by toranb
- stubbing out long polling using a service
https://github.com/alphasights/ember-calendar/blob/develop/tests/unit/components/as-calendar-test.js
Updating to new component integration tests from unit https://github.com/rwjblue/dashboard.aptible.com/commit/43995b61ff9ceea3b937ebd69de03637584f25e4?diff=split
##Forthcoming Features
Keep an eye on these for newer techniques when wrtiting tests
###Using new wait format for async testing
###New testing syntax RFC by rwjblue
##Tips
###Using Pretender with Ember Mirage
Under the hood Ember Mirage uses Pretender so you can access it directly using something like,
server.pretender.post('route', function(req) { assert.ok(SOMETHING)} )