Skip to content

Commit

Permalink
Organizing Jakefile and package.json to be able to run whatever neede…
Browse files Browse the repository at this point in the history
…d from the dev box or the CI box.
  • Loading branch information
gtramontina committed Jun 30, 2011
1 parent 40639a6 commit bdbd5c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
23 changes: 18 additions & 5 deletions Jakefile.coffee
Original file line number Diff line number Diff line change
@@ -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')()
Expand All @@ -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 <path/to/file.xml>'
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
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name" : "Writeboard!",
"name" : "Writeboard",
"description" : "Collaborative Whiteboard",
"version" : "0.0.1",
"homepage" : "writeboard.me",
Expand All @@ -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"
Expand Down

0 comments on commit bdbd5c9

Please sign in to comment.