Mountebank can simulate fixed delays (wait) and fixed errors (static is responses), but there is no built-in way to inject random faults. Today people either write inject JavaScript or put Toxiproxy in front of mb.
Proposal: a new chaos behavior alongside wait, copy, etc.
{
"responses": [{ "is": { "statusCode": 200, "body": "ok" } }],
"_behaviors": {
"chaos": {
"errorRate": 0.1,
"errorStatusCode": 500,
"latencyRate": 0.05,
"maxLatencyMs": 5000
}
}
}
All fields default to 0. No new dependencies (just Math.random). Protocol-agnostic, composable with other behaviors.
Happy to send a PR if this sounds reasonable. One open question: should the behavior be named chaos, fault, or faults?
Mountebank can simulate fixed delays (
wait) and fixed errors (staticisresponses), but there is no built-in way to inject random faults. Today people either writeinjectJavaScript or put Toxiproxy in front of mb.Proposal: a new
chaosbehavior alongsidewait,copy, etc.{ "responses": [{ "is": { "statusCode": 200, "body": "ok" } }], "_behaviors": { "chaos": { "errorRate": 0.1, "errorStatusCode": 500, "latencyRate": 0.05, "maxLatencyMs": 5000 } } }All fields default to 0. No new dependencies (just
Math.random). Protocol-agnostic, composable with other behaviors.Happy to send a PR if this sounds reasonable. One open question: should the behavior be named
chaos,fault, orfaults?