File size: 450 Bytes
23ac194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict'

const { test } = require('node:test')
const build = require('..')

test('object with custom format field', (t) => {
  t.plan(1)

  const schema = {
    title: 'object with custom format field',
    type: 'object',
    properties: {
      str: {
        type: 'string',
        format: 'test-format'
      }
    }
  }

  const stringify = build(schema)

  t.assert.doesNotThrow(() => {
    stringify({
      str: 'string'
    })
  })
})