test-machinepack
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "test-machinepack", | ||
"author": "Mike McNeil <@mikermcneil>", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Raw test runner for machinepacks (also includes a simple stub test driver)", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -54,6 +54,7 @@ /** | ||
// If configured input value is a string, but the machine is NOT expecting | ||
// a string specifically, then attempt to parse. | ||
var isExpectingString = (rttc.infer(inputDef.example) === 'string'); | ||
if (_.isString(valToUse) && !isExpectingString) { | ||
// If configured input value is a string, but the machine is expecting | ||
// a JSON value, then attempt to parse. | ||
var typeSchema = rttc.infer(inputDef.example); | ||
var isExpectingJson = (typeSchema !== 'string' && typeSchema !== 'number' && typeSchema !== 'boolean' && typeSchema !== 'lamda'); | ||
if (_.isString(valToUse) && isExpectingJson) { | ||
try { | ||
@@ -138,7 +139,6 @@ valToUse = JSON.parse(valToUse); | ||
// If output assertion is a string, but the machine is NOT expecting | ||
// a string specifically, then attempt to parse the output assertion | ||
// before performing the check. | ||
var isExpectingString = (typeSchema === 'string'); | ||
if (_.isString(outputAssertion) && !isExpectingString) { | ||
// If output assertion is a string, but the machine is expecting JSON | ||
// then attempt to parse the output assertion before performing the check. | ||
var isExpectingJson = (typeSchema !== 'string' && typeSchema !== 'number' && typeSchema !== 'boolean' && typeSchema !== 'lamda'); | ||
if (_.isString(outputAssertion) && isExpectingJson) { | ||
try { | ||
@@ -145,0 +145,0 @@ outputAssertion = JSON.parse(outputAssertion); |
21661