mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:49:12 +02:00
Added functionnalities to JS UnitTests
This commit is contained in:
parent
0e5af5afea
commit
ff378b60ac
1 changed files with 13 additions and 1 deletions
|
@ -65,4 +65,16 @@ UnitTest.prototype.assertNull = function(value, message) {
|
||||||
if (value !== null) {
|
if (value !== null) {
|
||||||
throw new AssertionException(value, null, message);
|
throw new AssertionException(value, null, message);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
UnitTest.prototype.arrayEqual = function(array1, array2, message) {
|
||||||
|
this.numAssertions++;
|
||||||
|
if (array1.length !== array2.length) {
|
||||||
|
throw new AssertionException(array1.length , array2.length , message);
|
||||||
|
}
|
||||||
|
for (var i = 0; i < array1.length; ++i) {
|
||||||
|
if (array1[i] !== array2[i]) {
|
||||||
|
throw new AssertionException(array1[i], array2[i], message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue