local_time 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,50 +0,0 @@
1
- fs = require 'fs'
2
- print = (s) -> fs.write "/dev/stderr", s, 'w'
3
-
4
- page = new WebPage()
5
- page.onConsoleMessage = (msg) -> console.error msg
6
-
7
- timeoutId = null
8
- deferTimeout = ->
9
- clearTimeout timeoutId if timeoutId
10
- timeoutId = setTimeout ->
11
- console.error "Timeout"
12
- phantom.exit 1
13
- , 3000
14
-
15
- console.log "Local time: #{new Date}"
16
-
17
- page.open phantom.args[0], ->
18
- deferTimeout()
19
-
20
- setInterval ->
21
- tests = page.evaluate ->
22
- tests = document.getElementById('qunit-tests').children
23
- for test in tests when test.className isnt 'running' and not test.recorded
24
- test.recorded = true
25
- if test.className is 'pass'
26
- '.'
27
- else if test.className is 'fail'
28
- 'F'
29
-
30
- for test in tests when test
31
- deferTimeout()
32
- print test
33
-
34
- result = page.evaluate ->
35
- result = document.getElementById('qunit-testresult')
36
- tests = document.getElementById('qunit-tests').children
37
-
38
- if result.innerText.match /completed/
39
- console.error ""
40
-
41
- for test in tests when test.className is 'fail'
42
- console.error test.innerText
43
-
44
- console.error result.innerText
45
- return parseInt result.getElementsByClassName('failed')[0].innerText
46
-
47
- return
48
-
49
- phantom.exit result if result?
50
- , 100