UNPKG

homebridge-config-ui-x

Version:

A web based management, configuration and control platform for Homebridge

23 lines (17 loc) 512 B
'use strict' const test = require('tap').test const validator = require('is-my-json-valid') const build = require('..') test('render a a date in a string as JSON', (t) => { t.plan(2) const schema = { title: 'a date in a string', type: 'string' } const toStringify = new Date() const validate = validator(schema) const stringify = build(schema) const output = stringify(toStringify) t.equal(output, JSON.stringify(toStringify)) t.ok(validate(JSON.parse(output)), 'valid schema') })