aboutsummaryrefslogtreecommitdiffstats
path: root/test/schema_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 21:41:00 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-09 21:41:00 +0800
commit47be6a0c3007f139999bb0009e46cbd1be9e3d3f (patch)
tree0ca8875598d71ef9f7a536b682e05e773d1bd6ec /test/schema_test.ts
parentc59efdde1d4143511cefef48323fed56deb69b93 (diff)
downloaddexon-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/schema_test.ts')
-rw-r--r--test/schema_test.ts6
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', () => {