artillery-core
Advanced tools
Comparing version 1.5.5 to 1.5.6
@@ -340,4 +340,8 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
function extractJSONPath(doc, expr) { | ||
let result = jsonpath.eval(doc, expr)[0]; | ||
return result; | ||
let results = jsonpath.eval(doc, expr); | ||
if (results.length > 1) { | ||
return results[randomInt(0, results.length - 1)]; | ||
} else { | ||
return results[0]; | ||
} | ||
} | ||
@@ -371,1 +375,5 @@ | ||
} | ||
function randomInt (low, high) { | ||
return Math.floor(Math.random() * (high - low + 1) + low); | ||
} |
{ | ||
"name": "artillery-core", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"description": "core load-generating functionality of Artillery", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"JSONPath": "0.10.0", | ||
"JSONPath": "0.11.2", | ||
"arrivals": "latest", | ||
@@ -24,0 +24,0 @@ "async": "1.5.2", |
56409
1194
+ AddedJSONPath@0.11.2(transitive)
- RemovedJSONPath@0.10.0(transitive)
- Removedunderscore@1.13.7(transitive)
UpdatedJSONPath@0.11.2