var BpmnModdle = require('bpmn-moddle'); describe('model - browser support', function() { var moddle = new BpmnModdle(); function read(xml, callback, done) { moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions) { if (err) { done(err); } else { callback(definitions); done(); } }); } it('should parse simple xml', function(done) { var xml = '' + '' + '' + '' + ''; // when read(xml, function(definitions) { // then expect(definitions.id).toBe('simple'); expect(definitions.targetNamespace).toBe('http://bpmn.io/schema/bpmn'); expect(definitions.rootElements.length).toBe(1); expect(definitions.rootElements[0].id).toBe('Process_1'); }, done); }); });