artillery-plugin-expect
Advanced tools
Comparing version 2.0.0-1 to 2.0.0-2
22
index.js
@@ -18,3 +18,3 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
function ExpectationsPlugin(script, events) { | ||
if(!global.artillery && !global.artillery.log) { | ||
if(!global.artillery || !global.artillery.log) { | ||
console.error('artillery-plugin-expect requires Artillery v2'); | ||
@@ -47,3 +47,2 @@ return; | ||
scenario.afterScenario = [].concat(scenario.afterScenario || []); | ||
scenario.afterScenario.push('expectationsPluginMaybeFlushDatadog'); | ||
}); | ||
@@ -53,3 +52,2 @@ | ||
script.config.processor.expectationsPluginOnError = expectationsPluginOnError; | ||
script.config.processor.expectationsPluginMaybeFlushDatadog = expectationsPluginMaybeFlushDatadog; | ||
@@ -150,20 +148,2 @@ script.config.processor.expectationsPluginSetExpectOptions = function( | ||
function expectationsPluginMaybeFlushDatadog(userContext, events, done) { | ||
if ( | ||
userContext.expectationsPlugin && | ||
userContext.expectationsPlugin.datadog | ||
) { | ||
userContext.expectationsPlugin.datadog.flush( | ||
() => { | ||
return done(); | ||
}, | ||
() => { | ||
return done(); | ||
} | ||
); | ||
} else { | ||
return done(); | ||
} | ||
} | ||
function maybeParseBody(res) { | ||
@@ -170,0 +150,0 @@ let body; |
{ | ||
"name": "artillery-plugin-expect", | ||
"version": "2.0.0-1", | ||
"version": "2.0.0-2", | ||
"description": "Expectations and assertions for HTTP", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
280294
625