common/corpus-common-addon/tests/helpers/module-for-acceptance.js
changeset 543 aaaf9b0b09f6
parent 406 cf0f23803a53
equal deleted inserted replaced
542:343675b8cc97 543:aaaf9b0b09f6
     1 import { module } from 'qunit';
     1 import { module } from 'qunit';
     2 import Ember from 'ember';
     2 import Ember from 'ember';
     3 import startApp from '../helpers/start-app';
     3 import startApp from '../helpers/start-app';
     4 import destroyApp from '../helpers/destroy-app';
     4 import destroyApp from '../helpers/destroy-app';
     5 
     5 
     6 const { RSVP: { Promise } } = Ember;
     6 const { RSVP: { resolve } } = Ember;
     7 
     7 
     8 export default function(name, options = {}) {
     8 export default function(name, options = {}) {
     9   module(name, {
     9   module(name, {
    10     beforeEach() {
    10     beforeEach() {
    11       this.application = startApp();
    11       this.application = startApp();
    15       }
    15       }
    16     },
    16     },
    17 
    17 
    18     afterEach() {
    18     afterEach() {
    19       let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
    19       let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
    20       return Promise.resolve(afterEach).then(() => destroyApp(this.application));
    20       return resolve(afterEach).then(() => destroyApp(this.application));
    21     }
    21     }
    22   });
    22   });
    23 }
    23 }