diff --git a/src/utils.spec.js b/src/utils.spec.js index 38142afff..f8463e150 100644 --- a/src/utils.spec.js +++ b/src/utils.spec.js @@ -6,12 +6,13 @@ import expect from 'must' import { ensureArray, - extractProperty + extractProperty, + formatXml } from './utils' // =================================================================== -describe('ensureArray', function () { +describe('ensureArray()', function () { it('wrap the value in an array', function () { const value = 'foo' @@ -31,7 +32,7 @@ describe('ensureArray', function () { // ------------------------------------------------------------------- -describe('extractProperty', function () { +describe('extractProperty()', function () { it('returns the value of the property', function () { const value = {} const obj = { prop: value } @@ -47,3 +48,21 @@ describe('extractProperty', function () { expect(obj).to.not.have.property('prop') }) }) + +// ------------------------------------------------------------------- + +describe('formatXml()', function () { + it('formats a JS object to an XML string', function () { + expect(formatXml({ + foo: { + bar: [ + {$: {baz: 'plop'}}, + {$: {baz: 'plip'}} + ] + } + })).to.equal(` + + +`) + }) +})