octoblu-device-schema-transmogrifier
Version:
Transmogrifies message and device schemas from version NULL to v1.0.0 for meshblu devices
22 lines (16 loc) • 836 B
text/coffeescript
{beforeEach, context, describe, it} = global
{expect} = require 'chai'
OctobluDeviceSchemaTransmogrifier = require '../'
describe 'migrating configure schemas', ->
context 'with an unknown version', ->
context 'a configureSchema with a single schema object', ->
beforeEach ->
=
optionsSchema: yo: 'mo'
= new OctobluDeviceSchemaTransmogrifier
= .transmogrify()
it 'should create the correct configure schema object', ->
expect(.schemas.configure.default.properties.options).to.deep.equal yo: 'mo'
expect(.schemas.configure.default.type).to.deep.equal 'object'
it 'should remove old configure schema', ->
expect(.optionsSchema).not.to.exist