author | ymh <ymh.work@gmail.com> |
Wed, 02 Mar 2016 13:47:07 +0100 | |
changeset 136 | 5fed7e1716c2 |
child 155 | 76ae75975ee2 |
permissions | -rw-r--r-- |
136 | 1 |
import { module } from 'qunit'; |
2 |
import startApp from '../helpers/start-app'; |
|
3 |
import destroyApp from '../helpers/destroy-app'; |
|
4 |
||
5 |
export default function(name, options = {}) { |
|
6 |
module(name, { |
|
7 |
beforeEach() { |
|
8 |
this.application = startApp(); |
|
9 |
||
10 |
if (options.beforeEach) { |
|
11 |
options.beforeEach.apply(this, arguments); |
|
12 |
} |
|
13 |
}, |
|
14 |
||
15 |
afterEach() { |
|
16 |
if (options.afterEach) { |
|
17 |
options.afterEach.apply(this, arguments); |
|
18 |
} |
|
19 |
||
20 |
destroyApp(this.application); |
|
21 |
} |
|
22 |
}); |
|
23 |
} |