From 57e4d9cfdc8401268c2b0bc18eb1c4e01bf29397 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 12 Sep 2013 14:15:08 -0700 Subject: [PATCH] Defer karma tests until after WebComponentsReady Match mocha test runner timings --- test/js/karma-defer-tests.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/js/karma-defer-tests.js diff --git a/test/js/karma-defer-tests.js b/test/js/karma-defer-tests.js new file mode 100644 index 0000000..c011985 --- /dev/null +++ b/test/js/karma-defer-tests.js @@ -0,0 +1,14 @@ +/* + * Copyright 2013 The Polymer Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +// defer start of tests until after WebComponentsReady event +if (window.__karma__) { + window.__karma__.loaded = function() { + window.addEventListener('WebComponentsReady', function() { + window.__karma__.start(); + }); + }; +}