From d87cbc3b7947b3a204922eb335b047030f566593 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Sun, 26 Jun 2016 23:28:53 +0200 Subject: [PATCH] chore(test/helper): cleanup old bpmn-js This speeds up the test suite runs, now as the suite gets larger. --- test/helper/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/helper/index.js b/test/helper/index.js index 05cdf6ba..35ff78ee 100644 --- a/test/helper/index.js +++ b/test/helper/index.js @@ -108,6 +108,11 @@ function bootstrapBpmnJS(BpmnJS, diagram, options, locals) { _options.additionalModules = unique(_options.additionalModules); } + // clean up old bpmn-js instance + if (BPMN_JS) { + BPMN_JS.destroy(); + } + BPMN_JS = new BpmnJS(_options); BPMN_JS.importXML(diagram, done);