open-nomad/ui/tests/helpers/setup-ability.js
2023-04-10 15:36:59 +00:00

17 lines
355 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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;
});
};