Comparing version 1.1.1 to 1.1.2
@@ -72,2 +72,3 @@ /*jslint node: true */ | ||
code: combo.__responseCode, | ||
status: undefined, | ||
schema: settings.response && Joi.compile(settings.response.schema) | ||
@@ -77,2 +78,11 @@ } | ||
if(settings.response.status) { | ||
test.response.status = {}; | ||
Object.keys(settings.response.status).forEach(function(key) { | ||
var joiValidation = settings.response.status[key]; | ||
test.response.status[key] = Joi.compile(joiValidation); | ||
}); | ||
} | ||
if (Object.keys(combo).length === 0) { | ||
@@ -79,0 +89,0 @@ config.testCallback(test); |
@@ -98,3 +98,7 @@ /*jslint node: true */ | ||
if (responseObj.schema && Object.keys(responseObj.schema).length > 0) { | ||
if (responseObj.status && responseObj.status[raw.statusCode]) { | ||
return joiAssert(raw.result, responseObj.status[raw.statusCode], 'Response check'); | ||
} else if (responseObj.schema && Object.keys(responseObj.schema).length > 0) { | ||
return joiAssert(raw.result, responseObj.schema, 'Response check'); | ||
@@ -101,0 +105,0 @@ } |
{ | ||
"name": "patronus", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Specification-driven REST API testing", | ||
@@ -5,0 +5,0 @@ "main": "lib/Patronus.js", |
53948
1100