How to use the ember-test-helpers.TestModule.extend function in ember-test-helpers

To help you get started, we’ve selected a few ember-test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ember-animation / ember-animated / tests / helpers / module-for-integration.js View on Github external
import Ember from 'ember';
import { TestModule, getContext, setContext } from 'ember-test-helpers';
import { getResolver } from 'ember-test-helpers/test-resolver';

var TestModuleForIntegration = TestModule.extend({
  init: function(name, description, callbacks) {
    this._super.call(this, name, description, callbacks);
    this.setupSteps.push(this.setupIntegrationHelpers);
    this.teardownSteps.push(this.teardownView);
  },

  setupIntegrationHelpers: function() {
    var self = this;
    var context = this.context;
    context.dispatcher = Ember.EventDispatcher.create();
    context.dispatcher.setup({}, '#ember-testing');
    this.actionHooks = {};

    context.render = function(template) {
      if (Ember.isArray(template)) {
        template = template.join('');