Of course, providing your own sample or default value will override the generated default, so this is only going to show up in the case with no sample. If no information about context can be guessed for a particular string element, then a simple Lorem Ipsum nonsense word or words will be used.
In order to provide consistent output, there is now a seed option for the example method that sets the Mersenne twister seed value. The tests are written to not depend on this, as the order of returned items may change with subsequent faker.js releases.
Also, you can still manually override all of this magic by providing your own default generator function. For example, this replaces each generated default value with the name of the refract element:
import eidolon from 'eidolon';
function myDefaultValue(refract, path) {
return refract.element;
}
eidolon.example({ /* ... some refract structure ... */}, [], {
defaultValue: myDefaultValue
});
For example, given the following MSON input with no samples or default values:
You would get something like:
Of course, providing your own sample or default value will override the generated default, so this is only going to show up in the case with no sample. If no information about context can be guessed for a particular
string
element, then a simple Lorem Ipsum nonsense word or words will be used.In order to provide consistent output, there is now a
seed
option for theexample
method that sets the Mersenne twister seed value. The tests are written to not depend on this, as the order of returned items may change with subsequent faker.js releases.Also, you can still manually override all of this magic by providing your own default generator function. For example, this replaces each generated default value with the name of the refract element:
cc @Baggz