lib/index.js
function generate(schema) {
  const ret = [];
  if (!validate(schema)) {
    return ret;
  }

  const fullSample = jsf(schema);
  if (!fullSample) {
    return ret;
  }

  ret.push({
    valid: true,
    data: fullSample,
    message: 'should work with all required properties'
  });

  ret.push(...generateFromRequired(schema));
  ret.push(...generateFromRequired(schema, false));
  ret.push(...generateForTypes(schema));

  return ret;
}
function generate(schema) {
  const ret = [];
  if (!validate(schema)) {
    return ret;
  }

  const fullSample = jsf(schema);
  if (!fullSample) {
    return ret;
  }

  ret.push({
    valid: true,
    data: fullSample,
    message: 'should work with all required properties'
  });

  ret.push(...generateFromRequired(schema));
  ret.push(...generateFromRequired(schema, false));
  ret.push(...generateForTypes(schema));

  return ret;
}
function generate ( schema ) { const ret = [ ] ; if ( ! validate ( schema ) ) { return ret ; } const fullSample = jsf ( schema ) ; if ( ! fullSample ) { return ret ; } ret . push ( { valid : true , data : fullSample , message : 'should work with all required properties' } ) ; ret . push ( ... generateFromRequired ( schema ) ) ; ret . push ( ... generateFromRequired ( schema , false ) ) ; ret . push ( ... generateForTypes ( schema ) ) ; return ret ; }
Generates test data based on JSON schema
@param  {Object} schema Fully expanded (no <code>$ref</code>) JSON Schema
@return {Array} Array of test data objects
Generates test data based on JSON schema