har-to-k6
Version:
Convert LI-HAR to k6 script
23 lines (18 loc) • 472 B
JavaScript
const { CheckCondition, CheckSubject, CheckType } = require('../../enum')
function check(spec) {
spec.state.negated = negated(spec)
spec.state.plural = plural(spec)
}
/*
* Check condition is negated.
*/
function negated(spec) {
return spec.condition === CheckCondition.NotContains
}
/*
* Input data is plural.
*/
function plural(spec) {
return spec.subject === CheckSubject.ResponseHeaders || spec.type === CheckType.JSONPathValue
}
module.exports = check