JSON Chaos
Inspired by Chaos Monkey, JSON Chaos is a tool that randomly changes properties in objects. It is useful to validate a strict API:
; const person = name: 'John' age: 21 ; console;// { name: 45423, age: true } console;// { name: 1673, age: 'hello' } console; // No mutations// { name: 'John', age: 21 }
It ensures these:
- The Object retains the same structure
- The properties (leafs) change their type
By default it will change up to 100 properties, you can modify this with the second argument:
const person = name: 'John' age: 21 ; // Change only one of those properties;
Useful for testing:
// A valid schema; ;