Skip to content

Instantly share code, notes, and snippets.

@kuzuha
Created June 13, 2011 14:07
Show Gist options
  • Save kuzuha/1022834 to your computer and use it in GitHub Desktop.
Save kuzuha/1022834 to your computer and use it in GitHub Desktop.
Ti.include 'qunit/qunit.js'
Ti.include 'qunit/qunit-tap.js'
qunitTap QUnit, (message) ->
Ti.API.info message
xhr = Ti.Network.createHTTPClient()
xhr.open 'POST', 'http://192.168.3.2:5000/tap', false
xhr.send tap : message
, noPlan: true
is_dir = (dir) -> Boolean dir.getDirectoryListing()
run_tests = (dir) ->
test_dir = Ti.Filesystem.getFile dir
if not is_dir test_dir
return
for file in test_dir.getDirectoryListing()
path = dir + Ti.Filesystem.separator + file
if is_dir Ti.Filesystem.getFile path
arguments.callee path
else if path.match /\.js$/
Ti.include path
return
run_tests 'test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment