mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Integrate regression tests
Add js regression structure and configured mocha
This commit is contained in:
parent
8d08167d11
commit
29f032502c
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
build/
|
build/
|
||||||
.idea/
|
.idea/
|
||||||
config.log
|
config.log
|
||||||
|
test/js/npm-debug.log
|
||||||
|
11
test/js/regression/bug.4102.js
Normal file
11
test/js/regression/bug.4102.js
Normal file
@ -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)
|
SCRIPTNAME=$(readlink -f $0)
|
||||||
DIR=$(dirname $SCRIPTNAME)
|
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
|
# Make sure that the destination directory for logs and reports exists
|
||||||
mkdir -p $DIR/../../build/log
|
mkdir -p $DIR/../../build/log
|
||||||
|
|
||||||
mocha --reporter "xunit" --recursive "$@" . > $DIR/../../build/log/mocha_results.xml
|
cd $DIR
|
||||||
mocha --reporter "cobertura" --recursive "$@" . > $DIR/../../build/log/mocha_coverage.xml
|
|
||||||
|
|
||||||
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…
x
Reference in New Issue
Block a user