Projektstart

This commit is contained in:
2026-01-22 15:49:12 +01:00
parent 7212eb6f7a
commit 57e5f652f8
10637 changed files with 2598792 additions and 64 deletions

View File

@@ -0,0 +1,30 @@
'use strict'
const assert = require('node:assert/strict')
const { test } = require('node:test')
const { mergeSchemas } = require('../index')
const { defaultResolver } = require('./utils')
test('should merge empty schema and minLength keyword', () => {
const schema1 = { type: 'string' }
const schema2 = { type: 'string', minLength: 42 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'string', minLength: 42 })
})
test('should merge equal minLength values', () => {
const schema1 = { type: 'string', minLength: 42 }
const schema2 = { type: 'string', minLength: 42 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'string', minLength: 42 })
})
test('should merge different minLength values', () => {
const schema1 = { type: 'string', minLength: 42 }
const schema2 = { type: 'string', minLength: 43 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'string', minLength: 43 })
})