[Pkg-javascript-commits] [node-mocks-http] 06/296: Simple script to jshint the files and run all the tests.
Thorsten Alteholz
alteholz at moszumanska.debian.org
Mon Feb 8 18:13:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
alteholz pushed a commit to branch master
in repository node-mocks-http.
commit d05cd08de89c1fb80faa26bead53adbb5a803ea6
Author: Howard Abrams <howard at cloud-eco.com>
Date: Sun Feb 19 10:07:05 2012 -0800
Simple script to jshint the files and run all the tests.
---
run-tests | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/run-tests b/run-tests
new file mode 100755
index 0000000..d482f4e
--- /dev/null
+++ b/run-tests
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# This will run the NodeUnit tests. If `nodeunit` isn't installed, type:
+#
+# sudo npm install nodeunit
+# sudo npm install jshint
+
+if type jshint >/dev/null 2>&1
+then
+ FILES="`find examples lib -name '*.js'`"
+ TMPHINT=/tmp/jshint-results
+
+ for FILE in $FILES
+ do
+ echo "Analyzing: $FILE"
+ HIDDEN_EXP="`dirname $FILE`/.`basename $FILE`-exp"
+ jshint $FILE > $TMPHINT
+ if [ $? -gt 0 ]
+ then
+ if [ -f "$HIDDEN_EXP" ]
+ then
+ diff $TMPHINT "$HIDDEN_EXP"
+ else
+ cat $TMPHINT
+ echo
+ echo "Note: If this is an expected (and accepted) warning, then:"
+ echo "cp '$TMPHINT' '$HIDDEN_EXP'"
+ echo
+ exit 1
+ fi
+ fi
+ done
+fi
+
+# Usage: nodeunit [options] testmodule1.js testfolder [...]
+# Options:
+#
+# --config FILE the path to a JSON file with options
+# --reporter FILE optional path to a reporter file to customize the output
+# --list-reporters list available build-in reporters
+# -t name, specify a test to run
+# -h, --help display this help and exit
+# -v, --version output version information and exit
+
+# Build-in reporters:
+# * browser: Browser-based test reporter
+# * default: Default tests reporter
+# * eclipse: Reporter for eclipse plugin
+# * html: Report tests result as HTML
+# * junit: jUnit XML test reports
+# * machineout: Tests reporter for machinally analysis
+# * minimal: Pretty minimal output
+# * nested: Nested test reporter
+# * skip_passed: Skip passed tests output
+# * tap: TAP output
+# * verbose: Verbose tests reporter
+
+echo "Executing tests..."
+# OPTS="--reporter junit --output test/results"
+
+FILES="`find test -name 'test-*.js'`"
+
+# echo nodeunit $OPTS $FILES
+exec nodeunit $OPTS $FILES
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git
More information about the Pkg-javascript-commits
mailing list