import assert from 'assert'; import sinon from 'sinon'; import { Response } from '../lib/utils/plivoxml'; describe('PlivoXML', function () { it('should work', function (done) { const response = new Response(); response.addPreAnswer(); response.addRecord(); response.addHangup(); response.addSpeak('text').then(function (result) { response.addWait(); response.addDTMF('123'); response.addConference('test'); response.addRedirect('url'); response.addGetDigits(); response.addPlay('url'); const dial = response.addDial(); dial.addNumber('123'); dial.addUser('sip:test@sip.plivo.com'); response.addMessage('∫test', { src: '123', dst: '456', }); assert.equal('text123testurlurl123sip:test@sip.plivo.com∫test', response.toXML()); done(); }).catch(function (err) { done("Failed to test Plivo Xml due to unknown error"); }); }); });