github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/tests/helpers/setup-ability.js (about)

     1  export default (ability) => (hooks) => {
     2    hooks.beforeEach(function () {
     3      this.ability = this.owner.lookup(`ability:${ability}`);
     4      this.can = this.owner.lookup('service:can');
     5    });
     6  
     7    hooks.afterEach(function () {
     8      delete this.ability;
     9      delete this.can;
    10    });
    11  };