Buckets:
ktongue/docker_container / .cache /opencode /node_modules /@fastify /merge-json-schemas /test /max-length.test.js
| 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 maxLength keyword', () => { | |
| const schema1 = { type: 'string' } | |
| const schema2 = { type: 'string', maxLength: 42 } | |
| const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver }) | |
| assert.deepStrictEqual(mergedSchema, { type: 'string', maxLength: 42 }) | |
| }) | |
| test('should merge equal maxLength values', () => { | |
| const schema1 = { type: 'string', maxLength: 42 } | |
| const schema2 = { type: 'string', maxLength: 42 } | |
| const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver }) | |
| assert.deepStrictEqual(mergedSchema, { type: 'string', maxLength: 42 }) | |
| }) | |
| test('should merge different maxLength values', () => { | |
| const schema1 = { type: 'string', maxLength: 42 } | |
| const schema2 = { type: 'string', maxLength: 43 } | |
| const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver }) | |
| assert.deepStrictEqual(mergedSchema, { type: 'string', maxLength: 42 }) | |
| }) | |
Xet Storage Details
- Size:
- 1.13 kB
- Xet hash:
- 963d80cb4841b6481f70004e4298ac11bb441b7ade3211ce2a32e8b4dc2342f4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.