Comparing version 0.1.19-alpha.5 to 0.1.19-alpha.7
const { ArrayField, CharField, IntegerField } = require('..') | ||
const { AttrModel } = require('../../models') | ||
const { FieldValidationError, ValueError } = require('../../errors') | ||
const { NestedValidationError, ValueError } = require('../../errors') | ||
@@ -25,3 +25,3 @@ describe('ArrayField', () => { | ||
const inst = new TestClass({ testField: null }) | ||
await expect(inst.validate()).rejects.toBeInstanceOf(FieldValidationError) | ||
await expect(inst.validate()).rejects.toBeInstanceOf(NestedValidationError) | ||
}) | ||
@@ -28,0 +28,0 @@ |
@@ -1,2 +0,2 @@ | ||
const { NestedValidationError } = require('./errors') | ||
const { NestedValidationError, ValueError } = require('./errors') | ||
@@ -13,5 +13,3 @@ const serialize = (obj, ...args) => { | ||
const throwFirstUnknownError = errors => { | ||
const unknownErrors = errors.filter( | ||
err => !(err instanceof NestedValidationError) | ||
) | ||
const unknownErrors = errors.filter(err => !(err instanceof ValueError)) | ||
if (unknownErrors.length > 0) { | ||
@@ -18,0 +16,0 @@ throw unknownErrors[0] |
const { AttrModel, Field } = require('..') | ||
const { FieldValidationError } = require('../../errors') | ||
const { NestedValidationError } = require('../../errors') | ||
@@ -13,3 +13,3 @@ describe('Field model', () => { | ||
it('validate rejects null value on non-null field with FieldValidationError', async () => { | ||
it('validate rejects null value on non-null field with NestedValidationError', async () => { | ||
class TestClass extends AttrModel { | ||
@@ -19,4 +19,4 @@ static testField = new Field({ null: false }) | ||
const inst = new TestClass({ testField: null }) | ||
await expect(inst.validate()).rejects.toBeInstanceOf(FieldValidationError) | ||
await expect(inst.validate()).rejects.toBeInstanceOf(NestedValidationError) | ||
}) | ||
}) |
{ | ||
"name": "djorm", | ||
"version": "0.1.19-alpha.5", | ||
"version": "0.1.19-alpha.7", | ||
"description": "Django like ORM framework", | ||
@@ -44,3 +44,3 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
}, | ||
"gitHead": "b42fae030101c40b418f5916b17b418585a2ca5c" | ||
"gitHead": "dff8abca86d4c02bd8b090c2233153aa3e8b8ab8" | ||
} |
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
91603
3155