You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
463 B
32 lines
463 B
4 years ago
|
'use strict'
|
||
|
|
||
|
const test = require('tap').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)
|
||
|
|
||
|
try {
|
||
|
stringify({
|
||
|
str: 'string'
|
||
|
})
|
||
|
|
||
|
t.pass()
|
||
|
} catch (e) {
|
||
|
t.fail()
|
||
|
}
|
||
|
})
|