chromium/third_party/blink/perf_tests/speedometer21/resources/todomvc/architecture-examples/emberjs-debug/source/tests/helpers/module-for-acceptance.js

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