asl-validator
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "asl-validator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Amazon States Language validator", | ||
@@ -5,0 +5,0 @@ "main": "./src/validator.js", |
# asl-validator | ||
A simple **Amazon States Language** validator based on JSON schemas. | ||
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/airware/asl-validator/blob/master/LICENSE) | ||
A simple [**Amazon States Language**](https://states-language.net/spec.html) validator based on JSON schemas. | ||
When writing your state machine (for AWS step functions), you can't locally validate you state machine definition without creating it. `asl-validator` makes it possible. | ||
@@ -6,0 +8,0 @@ |
@@ -14,6 +14,9 @@ const fs = require('fs'); | ||
const definition = JSON.parse(fs.readFileSync(path.join(__dirname, 'definitions', files[i]))); | ||
const { isValid, errors } = validator(definition); | ||
if (match[1] === 'valid') { | ||
expect(validator(definition)).toBeTruthy(); | ||
expect(isValid).toBeTruthy(); | ||
expect(errors).toBeNull(); | ||
} else if (match[1] === 'invalid') { | ||
expect(validator(definition)).toThrowError(/InvalidStateMachineDefinition/); | ||
expect(isValid).toBeFalsy(); | ||
expect(errors.length).toBeGreaterThan(0); | ||
} | ||
@@ -20,0 +23,0 @@ }); |
@@ -39,4 +39,4 @@ { | ||
}], | ||
"required": ["Type"], | ||
"required": ["Type", "Branches"], | ||
"additionalProperties": false | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24734
25
901
65