Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function(name, options = {}) {
module(name, {
beforeEach() {
this.application = startApp();
if (options.beforeEach) {
return options.beforeEach(...arguments);
}
},
afterEach() {
let afterEach = options.afterEach && options.afterEach(...arguments);
return resolve(afterEach).then(() => destroyApp(this.application));
}
});
}
export function scenarioModule(scenarios, callback) {
for (let scenario in scenarios) {
module(scenario, function(...moduleArgs) {
callback(scenarios[scenario], ...moduleArgs);
});
}
}