Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,635 changes: 737 additions & 898 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
"git-format-staged": "3.0.0",
"husky": "8.0.1",
"is-ci": "3.0.1",
"jest": "28.1.3",
"jest": "29.0.3",
"jest-fixtures": "0.6.0",
"jest-serializer-ansi-escapes": "^2.0.1",
"jsonpointer": "5.0.1",
"leven": "3.1.0",
"npm-pkg-lint": "1.11.1",
"prettier": "2.7.1",
"pretty-format": "28.1.3",
"svg-term-cli": "2.1.1",
"tsd": "0.23.0"
},
Expand All @@ -105,7 +105,7 @@
"lcov"
],
"snapshotSerializers": [
"pretty-format/ConvertAnsi"
"jest-serializer-ansi-escapes"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.js"
Expand Down
492 changes: 246 additions & 246 deletions src/__tests__/__snapshots__/index.js.snap

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/__tests__/helpers/create-error-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ describe('createErrorInstances', () => {
);

expect(errors).toMatchInlineSnapshot(`
Array [
[
EnumValidationError {
"data": undefined,
"jsonAst": undefined,
"jsonRaw": undefined,
"options": Object {
"options": {
"keyword": "enum",
"params": Object {
"allowedValues": Array [
"params": {
"allowedValues": [
"one",
"two",
"three",
Expand Down
98 changes: 49 additions & 49 deletions src/__tests__/helpers/filter-redundant-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ describe('filterRedundantErrors', () => {
};
filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"a": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"a": {
"children": {},
"errors": [
{
"keyword": "required",
},
],
Expand Down Expand Up @@ -73,14 +73,14 @@ describe('filterRedundantErrors', () => {
};
filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"a": Object {
"children": Object {
"b": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"a": {
"children": {
"b": {
"children": {},
"errors": [
{
"keyword": "required",
},
],
Expand Down Expand Up @@ -122,17 +122,17 @@ describe('filterRedundantErrors', () => {
};
filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"a": Object {
"children": Object {
"b": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"a": {
"children": {
"b": {
"children": {},
"errors": [
{
"keyword": "enum",
},
Object {
{
"keyword": "enum",
},
],
Expand Down Expand Up @@ -170,12 +170,12 @@ describe('filterRedundantErrors', () => {
};
filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"a2": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"a2": {
"children": {},
"errors": [
{
"keyword": "additionalProperty",
},
],
Expand Down Expand Up @@ -216,20 +216,20 @@ describe('filterRedundantErrors', () => {
};
filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"a1": Object {
"children": Object {
"b1": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"a1": {
"children": {
"b1": {
"children": {},
"errors": [
{
"keyword": "additionalProperty",
},
],
},
},
"errors": Array [],
"errors": [],
},
},
}
Expand Down Expand Up @@ -263,26 +263,26 @@ describe('filterRedundantErrors', () => {

filterRedundantErrors(tree);
expect(tree).toMatchInlineSnapshot(`
Object {
"children": Object {
"/object": Object {
"children": Object {
"/type": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"/object": {
"children": {
"/type": {
"children": {},
"errors": [
{
"keyword": "type",
},
Object {
{
"keyword": "type",
},
Object {
{
"keyword": "anyOf",
},
],
},
},
"errors": Array [],
"errors": [],
},
},
}
Expand Down
98 changes: 49 additions & 49 deletions src/__tests__/helpers/make-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { makeTree } from '../../helpers';
describe('makeTree', () => {
it('works on empty array', async () => {
expect(makeTree([])).toMatchInlineSnapshot(`
Object {
"children": Object {},
{
"children": {},
}
`);
});

it('works on root dataPath', async () => {
expect(makeTree([{ dataPath: '' }])).toMatchInlineSnapshot(`
Object {
"children": Object {
"": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"": {
"children": {},
"errors": [
{
"dataPath": "",
},
],
Expand All @@ -28,20 +28,20 @@ describe('makeTree', () => {

it('works on nested dataPath', async () => {
expect(makeTree([{ dataPath: '/root/child' }])).toMatchInlineSnapshot(`
Object {
"children": Object {
"/root": Object {
"children": Object {
"/child": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"/root": {
"children": {
"/child": {
"children": {},
"errors": [
{
"dataPath": "/root/child",
},
],
},
},
"errors": Array [],
"errors": [],
},
},
}
Expand All @@ -52,28 +52,28 @@ describe('makeTree', () => {
expect(
makeTree([{ dataPath: '/root/child/0' }, { dataPath: '/root/child/1' }])
).toMatchInlineSnapshot(`
Object {
"children": Object {
"/root": Object {
"children": Object {
"/child/0": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"/root": {
"children": {
"/child/0": {
"children": {},
"errors": [
{
"dataPath": "/root/child/0",
},
],
},
"/child/1": Object {
"children": Object {},
"errors": Array [
Object {
"/child/1": {
"children": {},
"errors": [
{
"dataPath": "/root/child/1",
},
],
},
},
"errors": Array [],
"errors": [],
},
},
}
Expand All @@ -87,38 +87,38 @@ describe('makeTree', () => {
{ dataPath: '/root/child/1/grand-child' },
])
).toMatchInlineSnapshot(`
Object {
"children": Object {
"/root": Object {
"children": Object {
"/child/0": Object {
"children": Object {
"/grand-child": Object {
"children": Object {},
"errors": Array [
Object {
{
"children": {
"/root": {
"children": {
"/child/0": {
"children": {
"/grand-child": {
"children": {},
"errors": [
{
"dataPath": "/root/child/0/grand-child",
},
],
},
},
"errors": Array [],
"errors": [],
},
"/child/1": Object {
"children": Object {
"/grand-child": Object {
"children": Object {},
"errors": Array [
Object {
"/child/1": {
"children": {
"/grand-child": {
"children": {},
"errors": [
{
"dataPath": "/root/child/1/grand-child",
},
],
},
},
"errors": Array [],
"errors": [],
},
},
"errors": Array [],
"errors": [],
},
},
}
Expand Down
Loading