Comparing version 5.2.8 to 5.2.9-skhema-enum-failure-19a97f9bcf56abdff86747e18731da2f7161d1bf
@@ -7,2 +7,6 @@ # Change Log | ||
## 5.2.9 - 2019-12-02 | ||
* Add test to show .filter() not working correctly [StefKors] | ||
## 5.2.8 - 2019-11-27 | ||
@@ -9,0 +13,0 @@ |
{ | ||
"name": "skhema", | ||
"version": "5.2.8", | ||
"version": "5.2.9-skhema-enum-failure-19a97f9bcf56abdff86747e18731da2f7161d1bf", | ||
"description": "JSON Schema utility collection", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1046,2 +1046,55 @@ /* | ||
ava.test('.filter() should correctly handle "enums" without modifing them', (test) => { | ||
// Comment | ||
const element = { | ||
id: 'ccdca138-e686-486c-a5df-6661be1102a9', | ||
slug: 'support-thread-test-thread-10eb964c-70e6-4a50-a0d6-364111416cdd', | ||
type: 'support-thread', | ||
active: true, | ||
version: '1.0.0', | ||
name: 'test thread', | ||
tags: [], | ||
markers: [], | ||
created_at: '2019-12-02T11:38:44.949Z', | ||
links: {}, | ||
requires: [], | ||
capabilities: [], | ||
data: { | ||
status: 'open' | ||
}, | ||
updated_at: null, | ||
linked_at: { | ||
'has attached element': '2019-12-02T11:38:45.071Z' | ||
} | ||
} | ||
const schema = { | ||
type: 'object', | ||
anyOf: [ | ||
{ | ||
type: 'object', | ||
properties: { | ||
type: { | ||
type: 'string', | ||
enum: [ | ||
'support-thread' | ||
] | ||
} | ||
} | ||
} | ||
], | ||
properties: { | ||
type: { | ||
enum: [ | ||
'message' | ||
] | ||
} | ||
} | ||
} | ||
const result = skhema.filter(schema, element) | ||
test.deepEqual(result, null) | ||
}) | ||
ava.test('.filter() should correctly handle "enum" inside "anyOf" with a non matching element', (test) => { | ||
@@ -1048,0 +1101,0 @@ const element = { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
144454
5172
1