Skip to content

Commit

Permalink
Merge branch 'pr-1017' into presubmit-stable-pr-1017
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Apr 23, 2014
2 parents a21a19e + 3fb15ef commit f876fad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/plus/08-emberjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ To execute javascript unit and integration tests with ember.js follow the steps

Note - the `files` section above should include all dependencies, ie- jQuery/handlebars/ember.js along with the js and handlebars files required to deploy and run your production ember.js application

Note - when testing ember applications, it is important that karma not being running the tests until the ember application has finished initialization. you will need to include a small bootstrap file in the `files` section above to enforce this. Here's an example:
```javascript
__karma__.loaded = function() {};

App.setupForTesting();
App.injectTestHelpers();

//this gate/check is required given that standard practice in Ember tests to is to call
//Ember.reset() in the afterEach/tearDown for each test. Doing so, causes the application
//to 're-initialize', resulting in repeated calls to the initialize function below
var karma_started = false;
App.initializer({
name: "run tests",
initialize: function(container, application) {
if (!karma_started) {
karma_started = true;
__karma__.start();
}
}
});
```

5. add a simple qunit test

```javascript
Expand Down

0 comments on commit f876fad

Please sign in to comment.