@wmfs/tymly-statelint
Advanced tools
Comparing version 1.14.0 to 1.14.1
@@ -0,1 +1,8 @@ | ||
## [1.14.1](https://github.com/wmfs/tymly-statelint/compare/v1.14.0...v1.14.1) (2019-11-21) | ||
### 🐛 Bug Fixes | ||
* Fix parameter and resource-config validation to allow them to contain any fields. ([103d1e6](https://github.com/wmfs/tymly-statelint/commit/103d1e6d3f0a5f1ec7ba53ed3e77a50dc1ae62e4)) | ||
# [1.14.0](https://github.com/wmfs/tymly-statelint/compare/v1.13.0...v1.14.0) (2019-11-14) | ||
@@ -2,0 +9,0 @@ |
const path = require('path') | ||
const fs = require('fs') | ||
const j2119Validator = require('@wmfs/j2119') | ||
const j2119SubObjectValidator = require('./j2119_schema_loader') | ||
const jsonSchemaValidator = require('./json_schema_loader') | ||
@@ -12,3 +12,3 @@ const kebabCase = require('lodash.kebabcase') | ||
const schemaTypes = { | ||
j2119: j2119Validator, | ||
j2119: j2119SubObjectValidator, | ||
json: jsonSchemaValidator | ||
@@ -97,3 +97,3 @@ } | ||
const usedValidator = this.recheckResourceConfig(name, resourceConfig, rcOk, validator) | ||
this.recheckParameters(name, state.Parameters, pOk, usedValidator ? null : validator, fixUps) | ||
this.recheckParameters(name, parameters, pOk, usedValidator ? null : validator, fixUps) | ||
} // checkResource | ||
@@ -100,0 +100,0 @@ |
{ | ||
"name": "@wmfs/tymly-statelint", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"description": "Validator for Amazon States Language with Tymly Extensions JSON.", | ||
@@ -5,0 +5,0 @@ "author": "West Midlands Fire Service", |
@@ -24,2 +24,5 @@ /* eslint-env mocha */ | ||
rootDirPath: path.resolve(__dirname, './fixtures/call-function/') | ||
}, | ||
FreeFormParameters: { | ||
rootDirPath: path.resolve(__dirname, './fixtures/free-form-parameters/') | ||
} | ||
@@ -452,2 +455,69 @@ } | ||
}) | ||
describe('Task Parameters validation where parameters may have any shape', () => { | ||
const machine = { | ||
StartAt: 'A', | ||
States: { | ||
A: { | ||
Type: 'Task', | ||
Resource: 'module:FreeFormParameters', | ||
End: true | ||
} | ||
} | ||
} | ||
verify( | ||
'Parameters validate when none given', | ||
machine, | ||
0 | ||
) | ||
machine.States.A['Parameters'] = { | ||
'function': 'getFruitName', | ||
'parameter': 'chirimoya' | ||
} | ||
verify( | ||
'Parameters validate with string fields', | ||
machine, | ||
0 | ||
) | ||
machine.States.A['Parameters'] = { | ||
'object': { | ||
'parameter': 'chirimoya' | ||
} | ||
} | ||
verify( | ||
'Parameters validate with object field', | ||
machine, | ||
0 | ||
) | ||
machine.States.A['Parameters'] = { | ||
functionName: 100 | ||
} | ||
verify( | ||
'Parameters validate with integer', | ||
machine, | ||
0 | ||
) | ||
machine.States.A['Parameters'] = { | ||
'functionName.$': '$.isBanana' | ||
} | ||
verify( | ||
'Parameters validates when extracting values', | ||
machine, | ||
0 | ||
) | ||
machine.States.A['Parameters'] = { | ||
'functionName.$': 'Wango' | ||
} | ||
verify( | ||
'Parameters extract value must be a Path ', | ||
machine, | ||
1 | ||
) | ||
}) | ||
}) | ||
@@ -454,0 +524,0 @@ |
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
45087
24
1030