Skip to content

Commit

Permalink
(- meta) Moving cake test into a script ... sort of
Browse files Browse the repository at this point in the history
  • Loading branch information
ELLIOTTCABLE committed May 28, 2013
1 parent 88901d1 commit e204e8b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
18 changes: 18 additions & 0 deletions Scripts/test.sh
@@ -0,0 +1,18 @@
#!/usr/bin/env sh

# Usage:
# ------
# This simply invokes `mocha` with some sensible defaults.
#
# FLAGS="--reporter dot --watch" npm run-script test
# FLAGS="--grep API" npm run-script test
#
# Unfortunately, at the moment, there's no way to pass flags to `npm run-script`; so I roll in flags
# using an environment-variable (`$FLAGS`). See: https://github.com/isaacs/npm/issues/3494

env NODE_ENV="$npm_package_config_mocha_ENV" \
./node_modules/.bin/mocha \
--compilers coffee:coffee-script \
--reporter "$npm_package_config_mocha_reporter" \
--ui "$npm_package_config_mocha_ui" \
$FLAGS "$npm_package_config_testFiles"
11 changes: 7 additions & 4 deletions package.json
Expand Up @@ -7,7 +7,8 @@
, "main" : "Library/Paws.js"

, "scripts" :{
"clean" : "./Scripts/clean.sh"
"test" : "./Scripts/test.sh"
, "clean" : "./Scripts/clean.sh"
, "coverage" : "./Scripts/coverage.sh 3> Coverage.html"
, "coveralls" : "./Scripts/coveralls.sh"
}
Expand All @@ -16,9 +17,11 @@
"testFiles" : "Test/*.coffee"
, "dirs" :{"source" :"Source"
, "instrumentation"
:"Source"

}}
:"Source" }
, "mocha" :{"ui" : "bdd"
, "reporter" : "spec"
, "ENV" : "test" }
}

, "engines" :{"node":"~0.10.7"}
, "dependencies" :{"coffee-script" : "~1.6.2"
Expand Down

0 comments on commit e204e8b

Please sign in to comment.