chore(test/helper): cleanup old bpmn-js

This speeds up the test suite runs, now as the
suite gets larger.
This commit is contained in:
Nico Rehwaldt 2016-06-26 23:28:53 +02:00
parent 1743c63d91
commit d87cbc3b79
1 changed files with 5 additions and 0 deletions

View File

@ -108,6 +108,11 @@ function bootstrapBpmnJS(BpmnJS, diagram, options, locals) {
_options.additionalModules = unique(_options.additionalModules); _options.additionalModules = unique(_options.additionalModules);
} }
// clean up old bpmn-js instance
if (BPMN_JS) {
BPMN_JS.destroy();
}
BPMN_JS = new BpmnJS(_options); BPMN_JS = new BpmnJS(_options);
BPMN_JS.importXML(diagram, done); BPMN_JS.importXML(diagram, done);