diff --git a/Jakefile.coffee b/Jakefile.coffee index aabeb65..1dffc97 100644 --- a/Jakefile.coffee +++ b/Jakefile.coffee @@ -1,10 +1,15 @@ +JESSIE_PATH = './node_modules/jessie/bin' + helper = require './build/lib/buildHelper' +sys = require 'sys' +# DEFAULT ====================================================================== desc "Please run a specific task - 'jake --tasks' to list existing tasks." task 'default', [], -> console.log "Please run a specific task - 'jake --tasks' to list existing tasks." -# TESTING +# TEST ========================================================================= namespace 'test', -> + # Functional ----------------------------------------------------------------- desc 'To run functional tests' task 'functional', () -> writeboardApp = require('./build/lib/server')() @@ -16,16 +21,24 @@ namespace 'test', -> writeboardApp.up() selenium.up() + # Unit ----------------------------------------------------------------------- desc 'To run unit tests' - task 'unit', -> - helper.execute 'jessie spec/unit' + task 'unit', (xmlFileName) -> + helper.execute "#{JESSIE_PATH}/jessie spec/unit" + + desc 'To run unit tests and send the results to' + task 'xunit', (xmlFileName) -> + if not xmlFileName + sys.puts "\033[31mFile path required.\033[0m" + sys.puts ' Usage: jake test:xunit ' + else helper.execute "#{JESSIE_PATH}/jessie -f xunit spec/unit | cat > #{xmlFileName}" -# RUN +# RUN ========================================================================== desc 'To run the http server' task 'run', -> helper.execute 'node app.js' -# PUBLISH +# PUBLISH ====================================================================== desc 'To make the project artifacts ready for deploy' task 'publish', ['test:unit'], (build_number) -> if not build_number diff --git a/package.json b/package.json index 52a406f..758b2da 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name" : "Writeboard!", + "name" : "Writeboard", "description" : "Collaborative Whiteboard", "version" : "0.0.1", "homepage" : "writeboard.me", @@ -9,8 +9,8 @@ "url" : "github.com/gtramontina/writeboard.it.git" }, "scripts" : { - "test" : "jessie spec/unit/", - "start" : "node app.js" + "test" : "jake test:unit", + "start" : "jake run" }, "engines" : { "node" : ">=0.4.8"