babylon.sceneloader.tests.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Describes the test suite.
  3. */
  4. describe('Babylon Tools', () => {
  5. var subject : BABYLON.Engine;
  6. /**
  7. * Loads the dependencies.
  8. */
  9. before(function (done) {
  10. this.timeout(180000);
  11. (BABYLONDEVTOOLS).Loader
  12. .useDist()
  13. .load(function () {
  14. done();
  15. });
  16. });
  17. /**
  18. * Create a nu engine subject before each test.
  19. */
  20. beforeEach(function () {
  21. subject = new BABYLON.NullEngine({
  22. renderHeight: 256,
  23. renderWidth: 256,
  24. textureSize: 256,
  25. deterministicLockstep: false,
  26. lockstepMaxSteps: 1
  27. });
  28. });
  29. /**
  30. * This test is more an integration test than a regular unit test but highlights how to rely
  31. * on the BABYLON.NullEngine in order to create complex test cases.
  32. */
  33. describe('#GLTF', () => {
  34. it('should load BoomBox GLTF', (done) => {
  35. mocha.timeout(10000);
  36. var scene = new BABYLON.Scene(subject);
  37. BABYLON.SceneLoader.Append("/Playground/scenes/BoomBox/", "BoomBox.gltf", scene, function () {
  38. scene.meshes.length.should.be.equal(2);
  39. scene.materials.length.should.be.equal(1);
  40. scene.multiMaterials.length.should.be.equal(0);
  41. done();
  42. });
  43. });
  44. });
  45. });