aboutsummaryrefslogtreecommitdiffstats
path: root/test/schema_test.ts
diff options
context:
space:
mode:
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', () => {