diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 21:41:00 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-09 21:41:00 +0800 |
commit | 47be6a0c3007f139999bb0009e46cbd1be9e3d3f (patch) | |
tree | 0ca8875598d71ef9f7a536b682e05e773d1bd6ec /test | |
parent | c59efdde1d4143511cefef48323fed56deb69b93 (diff) | |
download | dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar.gz dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar.bz2 dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar.lz dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar.xz dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.tar.zst dexon-sol-tools-47be6a0c3007f139999bb0009e46cbd1be9e3d3f.zip |
Tolerate more than one validation error in tests
Diffstat (limited to 'test')
-rw-r--r-- | test/schema_test.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/schema_test.ts b/test/schema_test.ts index e40ad1871..a608e867d 100644 --- a/test/schema_test.ts +++ b/test/schema_test.ts @@ -16,7 +16,11 @@ describe('Schema', () => { const validator = new SchemaValidator(); const validateAgainstSchema = (testCases: any[], schema: any, shouldFail = false) => { _.forEach(testCases, (testCase: any) => { - expect(validator.validate(testCase, schema).errors).to.be.lengthOf(shouldFail ? 1 : 0); + if (shouldFail) { + expect(validator.validate(testCase, schema).errors).to.be.lengthOf.at.least(1); + } else { + expect(validator.validate(testCase, schema).errors).to.be.lengthOf(0); + } }); }; describe('#numberSchema', () => { |