Skip to content

Instantly share code, notes, and snippets.

@loopDelicious
Last active July 27, 2017 18:07
Show Gist options
  • Save loopDelicious/e129f24f340a5d0a327c4716ab585456 to your computer and use it in GitHub Desktop.
Save loopDelicious/e129f24f340a5d0a327c4716ab585456 to your computer and use it in GitHub Desktop.
jsonValidation
// Load the JSON Schema
const customerSchema = JSON.parse(environment.customerSchema);
// Test whether the response matches the schema
var customer = JSON.parse(responseBody);
tests["Customer is valid"] = tv4.validate(customer, customerSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment