common/corpus-common-addon/tests/helpers/module-for-acceptance.js
author Chloe Laisne <chloe.laisne@gmail.com>
Tue, 27 Sep 2016 01:50:53 +0200
changeset 303 2fef8007c2b2
parent 136 5fed7e1716c2
child 406 cf0f23803a53
permissions -rw-r--r--
Transcript icon in player white by default and blue when active + Transcript font color darker

import { module } from 'qunit';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';

export default function(name, options = {}) {
  module(name, {
    beforeEach() {
      this.application = startApp();

      if (options.beforeEach) {
        options.beforeEach.apply(this, arguments);
      }
    },

    afterEach() {
      if (options.afterEach) {
        options.afterEach.apply(this, arguments);
      }

      destroyApp(this.application);
    }
  });
}