Open fczuardi opened 10 months ago
Even with a regular try/catch block this fails:
import { check } from 'k6'
import exec from 'k6/x/exec';
export function setup (){}
export function teardown (){}
export default function(){
check(1, {"1 === 1": n => n === 1})
check(2, {"2 === 2": n => n === 2})
try {
let out = exec.command("ls", ["non_existent_file"])
//should be the same behavior as
//throw new Error('My error message')
} catch(e) {
console.log(e.message)
}
check(3, {"3 === 3": n => n === 3})
}
maybe duplicate or similar than https://github.com/grafana/xk6-exec/issues/12
K6 documentation recommends the use of k6 chaijs for handling errors, using the describe function.
However it does not work with tests that uses exec.command, a failed command execution exits k6 run as well :(
steps to reproduce
expected behavior
actual behavior