har-to-k6
Version:
Convert LI-HAR to k6 script
16 lines (12 loc) • 309 B
JavaScript
const { js, from } = require('../../../codegen')
const template = js`
response => jsonpath.query(response.json(), ${from('expression')}).length > 0
`
function JSONPath(name, { comment, expression }) {
return {
name,
comment,
value: template({ expression }),
}
}
module.exports = JSONPath