aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStephen Blott2015-05-26 10:09:11 +0100
committerStephen Blott2015-05-26 10:09:11 +0100
commit1e236a21373f667f8fd1cec07df4b647b2b30e1c (patch)
tree515c5e7d788ca333450d1819021b3f56af69a3eb /tests
parent74c61f12eb90a39882b25fe54267937a17d6fa70 (diff)
parenta9f8798f8379a6db5f57eb9bdca9be0f35fae162 (diff)
downloadvimium-1e236a21373f667f8fd1cec07df4b647b2b30e1c.tar.bz2
Merge pull request #1685 from smblott-github/fix-ui_component-race-condition
Fix UI-Component race condition on start up.
Diffstat (limited to 'tests')
-rw-r--r--tests/dom_tests/phantom_runner.coffee29
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/dom_tests/phantom_runner.coffee b/tests/dom_tests/phantom_runner.coffee
index 93218724..e0382a35 100644
--- a/tests/dom_tests/phantom_runner.coffee
+++ b/tests/dom_tests/phantom_runner.coffee
@@ -37,15 +37,20 @@ page.open testfile, (status) ->
console.log 'Unable to load tests.'
phantom.exit 1
- testsFailed = page.evaluate ->
- Tests.run()
- return Tests.testsFailed
-
- if system.args[1] == '--coverage'
- data = page.evaluate -> JSON.stringify _$jscoverage
- fs.write dirname + 'dom_tests_coverage.json', data, 'w'
-
- if testsFailed > 0
- phantom.exit 1
- else
- phantom.exit 0
+ runTests = ->
+ testsFailed = page.evaluate ->
+ Tests.run()
+ return Tests.testsFailed
+
+ if system.args[1] == '--coverage'
+ data = page.evaluate -> JSON.stringify _$jscoverage
+ fs.write dirname + 'dom_tests_coverage.json', data, 'w'
+
+ if testsFailed > 0
+ phantom.exit 1
+ else
+ phantom.exit 0
+
+ # We add a short delay to allow asynchronous initialization (that is, initialization which happens on
+ # "nextTick") to complete.
+ setTimeout runTests, 10