open-nomad/ui/tests/helpers/setup-ability.js
2022-01-20 09:46:45 -05:00

12 lines
277 B
JavaScript

export default (ability) => (hooks) => {
hooks.beforeEach(function () {
this.ability = this.owner.lookup(`ability:${ability}`);
this.can = this.owner.lookup('service:can');
});
hooks.afterEach(function () {
delete this.ability;
delete this.can;
});
};