summaryrefslogtreecommitdiff
path: root/test/json-schema.test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-10 23:12:01 -0500
committerGitHub <noreply@github.com>2024-02-11 04:12:01 +0000
commit765f1ede668f70e3af7717bf4d5f05dbf009c7f8 (patch)
treee73f481c93f8bbaa42f7c8216190fb1cb4621301 /test/json-schema.test.js
parent805cf9cb3ea744a6d7c0a5da27fc9ef4e6f08626 (diff)
Eslint rule updates (#665)
* Padding newline rules * Update rules * Update rules * Update rules * Updates * Update object quotes * Merge similar ts and js rules * Change export spacing rules * Move typescript-eslint rules * Spacing * Actually save and commit changes
Diffstat (limited to 'test/json-schema.test.js')
-rw-r--r--test/json-schema.test.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/json-schema.test.js b/test/json-schema.test.js
index ab2c0c65..af4b7acd 100644
--- a/test/json-schema.test.js
+++ b/test/json-schema.test.js
@@ -520,7 +520,7 @@ function testValidate2() {
/* eslint-enable @stylistic/no-multi-spaces */
describe.each(data)('Schema %#', ({schema, inputs}) => {
- test.each(inputs)(`schemaValidate(${schema}, $value) -> $expected`, ({expected, value}) => {
+ test.each(inputs)(`schemaValidate(${JSON.stringify(schema)}, $value) -> $expected`, ({expected, value}) => {
const actual = schemaValidate(schema, value);
expect(actual).toStrictEqual(expected);
});
@@ -878,7 +878,7 @@ function testGetValidValueOrDefault1() {
];
describe.each(data)('Schema %#', ({schema, inputs}) => {
- test.each(inputs)(`getValidValueOrDefault(${schema}, %o) -> %o`, (value, expected) => {
+ test.each(inputs)(`getValidValueOrDefault(${JSON.stringify(schema)}, %o) -> %o`, (value, expected) => {
const actual = getValidValueOrDefault(schema, value);
expect(actual).toStrictEqual(expected);
});
@@ -985,11 +985,15 @@ function testProxy1() {
{error: true, value: ['default'], action: (value) => { value[0] = null; }},
{error: false, value: ['default'], action: (value) => { delete value[0]; }},
{error: false, value: ['default'], action: (value) => { value[1] = 'string'; }},
- {error: false, value: ['default'], action: (value) => {
- value[1] = 'string';
- if (value.length !== 2) { throw new Error(`Invalid length; expected=2; actual=${value.length}`); }
- if (typeof value.push !== 'function') { throw new Error(`Invalid push; expected=function; actual=${typeof value.push}`); }
- }}
+ {
+ error: false,
+ value: ['default'],
+ action: (value) => {
+ value[1] = 'string';
+ if (value.length !== 2) { throw new Error(`Invalid length; expected=2; actual=${value.length}`); }
+ if (typeof value.push !== 'function') { throw new Error(`Invalid push; expected=function; actual=${typeof value.push}`); }
+ }
+ }
]
},