Skip to content

Instantly share code, notes, and snippets.

@loopDelicious
Last active July 27, 2017 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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