Integrate regression tests
Add js regression structure and configured mocha
This commit is contained in:
parent
8d08167d11
commit
29f032502c
|
@ -1,3 +1,4 @@
|
|||
build/
|
||||
.idea/
|
||||
config.log
|
||||
config.log
|
||||
test/js/npm-debug.log
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
describe('regression test for bug #4102', function(){
|
||||
it('Object.create', function(){
|
||||
Object.create.should.be.a('function');
|
||||
|
||||
var t = {
|
||||
name: 'test123'
|
||||
};
|
||||
|
||||
t.should.have.property('name').and.equal('test123');
|
||||
});
|
||||
});
|
|
@ -4,11 +4,23 @@ set -o nounset
|
|||
|
||||
SCRIPTNAME=$(readlink -f $0)
|
||||
DIR=$(dirname $SCRIPTNAME)
|
||||
MOCHA=$(which mocha)
|
||||
DEFAULT="--recursive --require should"
|
||||
|
||||
if [[ ! -x $MOCHA ]]; then
|
||||
echo "mocha not found!";
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure that the destination directory for logs and reports exists
|
||||
mkdir -p $DIR/../../build/log
|
||||
|
||||
mocha --reporter "xunit" --recursive "$@" . > $DIR/../../build/log/mocha_results.xml
|
||||
mocha --reporter "cobertura" --recursive "$@" . > $DIR/../../build/log/mocha_coverage.xml
|
||||
cd $DIR
|
||||
|
||||
exit 0
|
||||
# Don't know where node modules are
|
||||
export NODE_PATH=.:/usr/local/lib/node_modules:/usr/lib/node_modules
|
||||
|
||||
$MOCHA --reporter "xunit" $DEFAULT "$@" . > $DIR/../../build/log/mocha_results.xml
|
||||
$MOCHA --reporter "mocha-cobertura-reporter" $DEFAULT "$@" . > $DIR/../../build/log/mocha_coverage.xml
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue