babylon.dictionaryMode.tests.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Describes the test suite.
  3. */
  4. describe('Babylon Mesh', () => {
  5. let subject: BABYLON.Engine;
  6. /**
  7. * Loads the dependencies.
  8. */
  9. before(function(done) {
  10. this.timeout(180000);
  11. (BABYLONDEVTOOLS).Loader
  12. .useDist()
  13. .testMode()
  14. .load(function() {
  15. // Force apply promise polyfill for consistent behavior between chrome headless, IE11, and other browsers.
  16. BABYLON.PromisePolyfill.Apply(true);
  17. done();
  18. });
  19. });
  20. /**
  21. * Create a new engine subject before each test.
  22. */
  23. beforeEach(function() {
  24. subject = new BABYLON.NullEngine({
  25. renderHeight: 256,
  26. renderWidth: 256,
  27. textureSize: 256,
  28. deterministicLockstep: false,
  29. lockstepMaxSteps: 1
  30. });
  31. });
  32. describe('#Mesh dictionary mode threshold', () => {
  33. it('No more than 128 own properties on a mesh', () => {
  34. const scene = new BABYLON.Scene(subject);
  35. const mesh = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
  36. var count = 0;
  37. for (var prop in mesh) {
  38. if (mesh.hasOwnProperty(prop)) {
  39. count++;
  40. }
  41. }
  42. expect(count).to.lessThan(128);
  43. });
  44. });
  45. });