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