mirror of
https://github.com/documize/community.git
synced 2025-07-21 14:19:43 +02:00
initial commit
This commit is contained in:
commit
18933c6767
1841 changed files with 810642 additions and 0 deletions
32
app/tests/helpers/module-for-acceptance.js
Normal file
32
app/tests/helpers/module-for-acceptance.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
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();
|
||||
stubAudit(this);
|
||||
stubUserNotification(this);
|
||||
|
||||
if (options.beforeEach) {
|
||||
options.beforeEach.apply(this, arguments);
|
||||
}
|
||||
|
||||
this.register = (fullName, Factory) => {
|
||||
let instance = this.application.__deprecatedInstance__;
|
||||
let registry = instance.register ? instance : instance.registry;
|
||||
|
||||
return registry.register(fullName, Factory);
|
||||
};
|
||||
},
|
||||
|
||||
afterEach() {
|
||||
destroyApp(this.application);
|
||||
|
||||
if (options.afterEach) {
|
||||
options.afterEach.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue