Socket
Socket
Sign inDemoInstall

djorm

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

djorm - npm Package Compare versions

Comparing version 0.1.19-alpha.5 to 0.1.19-alpha.7

4

fields/__tests__/ArrayField.js
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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc