Skip to content

Commit

Permalink
fix(ensure): check in beforeExit for both ensure plugin interfaces (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge authored Jul 17, 2023
1 parent afe4984 commit d1136f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/artillery-plugin-ensure/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ class EnsurePlugin {
this.script = script;
this.events = events;

const checks = this.script.config?.ensure || this.script.config?.plugins?.ensure;
const checks =
this.script.config?.ensure || this.script.config?.plugins?.ensure;

global.artillery.ext({
ext: 'beforeExit',
method: async (data) => {
if (
typeof this.script?.config?.ensure === 'undefined' ||
!checks ||
typeof process.env.ARTILLERY_DISABLE_ENSURE !== 'undefined'
) {
return;
Expand Down

0 comments on commit d1136f3

Please sign in to comment.