cms/app-client/tests/helpers/module-for-acceptance.js
author ymh <ymh.work@gmail.com>
Sat, 26 Mar 2016 00:24:34 +0100
changeset 144 03678acbfda3
parent 136 5fed7e1716c2
child 155 76ae75975ee2
permissions -rw-r--r--
Change collections uri + add link to cocoon collection

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);
    }
  });
}