integration.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. window.__karma__.loaded = function() {};
  2. // Loading tests
  3. var xhr = new XMLHttpRequest();
  4. xhr.open("GET", "/tests/validation/config.json", true);
  5. xhr.addEventListener("load", function () {
  6. if (xhr.status === 200) {
  7. config = JSON.parse(xhr.responseText);
  8. describe("Validation Tests", function() {
  9. before(function (done) {
  10. this.timeout(180000);
  11. require = null;
  12. BABYLONDEVTOOLS.Loader
  13. .require('/tests/validation/validation.js')
  14. .useDist()
  15. .load(function() {
  16. done();
  17. });
  18. });
  19. // Run tests
  20. for (let index = 0; index < config.tests.length; index++) {
  21. var test = config.tests[index];
  22. if (test.onlyVisual) {
  23. continue;
  24. }
  25. it(test.title, function(done) {
  26. this.timeout(180000);
  27. try {
  28. runTest(index, function(result) {
  29. try {
  30. expect(result).to.be.true;
  31. done();
  32. }
  33. catch (e) {
  34. done(e);
  35. }
  36. });
  37. }
  38. catch (e) {
  39. done(e);
  40. }
  41. });
  42. };
  43. });
  44. window.__karma__.start();
  45. }
  46. }, false);
  47. xhr.send();