Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define the JSON Schema
- const customerSchema = {
- "required": ["id"],
- "properties": {
- "id": {
- "type": "integer",
- "minimum": 100,
- "maximum": 1000
- },
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 25
- }
- }
- };
- // Test whether the response matches the schema
- var customer = JSON.parse(responseBody);
- tests["Customer is valid"] = tv4.validate(customer, customerSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement