summaryrefslogtreecommitdiffstats
path: root/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/emberjs-debug/source/tests/helpers/module-for-acceptance.js
blob: dbd80fc042c682caa20ef0d0e6845e4745e1ab0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
        }
    });
}