zulip/tools/test-js-with-node
Zev Benjamin e0eddabeb1 Add util.enforce_arity
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.

(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
2013-08-09 17:12:23 -04:00

19 lines
474 B
Bash
Executable File

#!/bin/bash -e
cd "$(dirname "$0")"/../zerver/tests/frontend/node
STATIC_DIR=`python -c 'import os;print os.path.realpath("../../../../static")'`
export NODE_PATH=$STATIC_DIR
NODEJS=$(which nodejs || which node)
# Run all the JS scripts in our test directory. The order that the scripts run in now
# is fairly arbitrary, as they run isolated from each other, and none of them are
# particularly slow.
for js_file in *.js
do
echo $js_file
$NODEJS $js_file
done