Skip to content

Commit

Permalink
feat(deps): Bumped all deps
Browse files Browse the repository at this point in the history
New awesome-ajv-errors handling for browser and node for style handling.
Updated jest snapshots for jest 29 defaults.
  • Loading branch information
grantila committed Feb 2, 2023
1 parent 80c2b2b commit 70039ef
Show file tree
Hide file tree
Showing 9 changed files with 1,897 additions and 1,925 deletions.
162 changes: 81 additions & 81 deletions lib/__snapshots__/extract-json-schema.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`extract-json-schema should be able to rename top-level names 1`] = `
Object {
"definitions": Object {
"Foo": Object {
{
"definitions": {
"Foo": {
"type": "number",
},
"Foo_2": Object {
"Foo_2": {
"type": "string",
},
},
}
`;

exports[`extract-json-schema should call non-decorated validator schemas 'Unknown' 1`] = `
Object {
"definitions": Object {
"Foo": Object {
{
"definitions": {
"Foo": {
"type": "number",
},
"Unknown_1": Object {
"Unknown_1": {
"type": "string",
},
},
}
`;

exports[`extract-json-schema should ignore non-decorated validator schemas 1`] = `
Object {
"definitions": Object {
"Foo": Object {
{
"definitions": {
"Foo": {
"type": "number",
},
},
}
`;

exports[`extract-json-schema should keep references in lookup table 1`] = `
Object {
"definitions": Object {
"Foo": Object {
{
"definitions": {
"Foo": {
"type": "number",
},
},
}
`;

exports[`extract-json-schema should keep references in lookup table 2`] = `
Object {
{
"type": "number",
}
`;

exports[`extract-json-schema should keep references in lookup table 3`] = `
Object {
"anyOf": Array [
Object {
{
"anyOf": [
{
"type": "string",
},
Object {
{
"type": "boolean",
},
],
}
`;

exports[`extract-json-schema should keep references in lookup table 4`] = `
Object {
"anyOf": Array [
Object {
{
"anyOf": [
{
"type": "string",
},
Object {
{
"$ref": "#/definitions/Foo",
},
],
}
`;

exports[`extract-json-schema should produce proper definitions for referenced schemas (using method no-refs) 1`] = `
Object {
"definitions": Object {
"Bar": Object {
{
"definitions": {
"Bar": {
"description": "Desc",
"examples": Array [
"examples": [
"Ex",
],
"properties": Object {
"bak": Object {
"properties": {
"bak": {
"type": "number",
},
"bar": Object {
"bar": {
"exclusiveMinimum": 17,
"type": "number",
},
"baz": Object {
"baz": {
"type": "number",
},
"foo": Object {
"foo": {
"description": "Description",
"examples": Array [
"examples": [
"Example",
],
"properties": Object {
"foo": Object {
"properties": {
"foo": {
"const": "bar",
"type": "string",
},
Expand All @@ -112,19 +112,19 @@ Object {
"type": "object",
},
},
"required": Array [
"required": [
"bar",
],
"title": "T",
"type": "object",
},
"Foo": Object {
"Foo": {
"description": "Description",
"examples": Array [
"examples": [
"Example",
],
"properties": Object {
"foo": Object {
"properties": {
"foo": {
"const": "bar",
"type": "string",
},
Expand All @@ -137,41 +137,41 @@ Object {
`;

exports[`extract-json-schema should produce proper definitions for referenced schemas (using method provided) 1`] = `
Object {
"definitions": Object {
"Bar": Object {
{
"definitions": {
"Bar": {
"description": "Desc",
"examples": Array [
"examples": [
"Ex",
],
"properties": Object {
"bak": Object {
"properties": {
"bak": {
"type": "number",
},
"bar": Object {
"bar": {
"exclusiveMinimum": 17,
"type": "number",
},
"baz": Object {
"baz": {
"type": "number",
},
"foo": Object {
"foo": {
"$ref": "#/definitions/Foo",
},
},
"required": Array [
"required": [
"bar",
],
"title": "T",
"type": "object",
},
"Foo": Object {
"Foo": {
"description": "Description",
"examples": Array [
"examples": [
"Example",
],
"properties": Object {
"foo": Object {
"properties": {
"foo": {
"const": "bar",
"type": "string",
},
Expand All @@ -184,44 +184,44 @@ Object {
`;

exports[`extract-json-schema should produce proper definitions for referenced schemas (using method ref-all) 1`] = `
Object {
"definitions": Object {
"Bar": Object {
{
"definitions": {
"Bar": {
"description": "Desc",
"examples": Array [
"examples": [
"Ex",
],
"properties": Object {
"bak": Object {
"properties": {
"bak": {
"$ref": "#/definitions/Baz",
},
"bar": Object {
"bar": {
"exclusiveMinimum": 17,
"type": "number",
},
"baz": Object {
"baz": {
"$ref": "#/definitions/Baz",
},
"foo": Object {
"foo": {
"$ref": "#/definitions/Foo",
},
},
"required": Array [
"required": [
"bar",
],
"title": "T",
"type": "object",
},
"Baz": Object {
"Baz": {
"type": "number",
},
"Foo": Object {
"Foo": {
"description": "Description",
"examples": Array [
"examples": [
"Example",
],
"properties": Object {
"foo": Object {
"properties": {
"foo": {
"const": "bar",
"type": "string",
},
Expand All @@ -234,35 +234,35 @@ Object {
`;

exports[`extract-json-schema should produce two (referenced) definitions for 2 schemas 1`] = `
Object {
"definitions": Object {
"Bar": Object {
{
"definitions": {
"Bar": {
"description": "Desc",
"examples": Array [
"examples": [
"Ex",
],
"properties": Object {
"bar": Object {
"properties": {
"bar": {
"exclusiveMinimum": 17,
"type": "number",
},
"foo": Object {
"foo": {
"$ref": "#/definitions/Foo",
},
},
"required": Array [
"required": [
"bar",
],
"title": "T",
"type": "object",
},
"Foo": Object {
"Foo": {
"description": "Description",
"examples": Array [
"examples": [
"Example",
],
"properties": Object {
"foo": Object {
"properties": {
"foo": {
"const": "bar",
"type": "string",
},
Expand Down
10 changes: 5 additions & 5 deletions lib/__snapshots__/index-nodejs.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ exports[`nodejs should get decorated ValidationError 1`] = `
"The type of the .foo value should be number, e.g. 42 (as number)
1 | {
> 2 | \\"foo\\": \\"42\\"
> 2 | "foo": "42"
| ^^^^ Replace this with e.g. 42 (as number)
3 | }"
`;

exports[`short-hands ensure 1`] = `
"Validation failed
The type of the .lastName value should be string, e.g. \\"42\\" (as string)
The type of the .lastName value should be string, e.g. "42" (as string)
1 | {
2 | \\"firstName\\": \\"Foo\\",
> 3 | \\"lastName\\": 42
| ^^ Replace this with e.g. \\"42\\" (as string)
2 | "firstName": "Foo",
> 3 | "lastName": 42
| ^^ Replace this with e.g. "42" (as string)
4 | }"
`;
14 changes: 7 additions & 7 deletions lib/ajv-errors-browser.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { prettify } from "awesome-ajv-errors/dist/index-browser.js"
import { styledPrettify } from "awesome-ajv-errors/dist/index-try-styled.js"
import { prettify } from "awesome-ajv-errors/plain"
import { styledPrettify } from "awesome-ajv-errors/try-styled"

import { setPrettify } from "./ajv-errors.js"
import { getSuretypeOptions, setSuretypeOptions } from "./options.js"

setPrettify( prettify );
styledPrettify
.then( prettify =>
{
setPrettify( prettify );

styledPrettify.then( prettify =>
{
// Coerce stylings to true (unless already configured by the user)
const opts = getSuretypeOptions( );
opts.colors = opts.colors ?? true;
opts.location = opts.location ?? true;
opts.bigNumbers = opts.bigNumbers ?? true;
setSuretypeOptions( opts );
} );
setPrettify( prettify );
}
);
2 changes: 1 addition & 1 deletion lib/ajv-errors-nodejs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { prettify } from "awesome-ajv-errors/dist/index-node.js"
import { prettify } from "awesome-ajv-errors"

import { setPrettify } from "./ajv-errors.js"

Expand Down
Loading

0 comments on commit 70039ef

Please sign in to comment.