download
raw
1.21 kB
'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 exclusiveMaximum keyword', () => {
const schema1 = { type: 'number' }
const schema2 = { type: 'number', exclusiveMaximum: 42 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'number', exclusiveMaximum: 42 })
})
test('should merge equal exclusiveMaximum values', () => {
const schema1 = { type: 'number', exclusiveMaximum: 42 }
const schema2 = { type: 'number', exclusiveMaximum: 42 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'number', exclusiveMaximum: 42 })
})
test('should merge different exclusiveMaximum values', () => {
const schema1 = { type: 'integer', exclusiveMaximum: 42 }
const schema2 = { type: 'integer', exclusiveMaximum: 43 }
const mergedSchema = mergeSchemas([schema1, schema2], { defaultResolver })
assert.deepStrictEqual(mergedSchema, { type: 'integer', exclusiveMaximum: 42 })
})

Xet Storage Details

Size:
1.21 kB
·
Xet hash:
ba781081d7ea94acb070992603d44cf349d7c0d7f683c90f2f874009f1ff6e66

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.