babylon.tools.tests.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Describes the test suite.
  3. */
  4. describe('Babylon Tools', () => {
  5. /**
  6. * Loads the dependencies.
  7. */
  8. before(function (done) {
  9. this.timeout(180000);
  10. (BABYLONDEVTOOLS).Loader
  11. .useDist()
  12. .load(function () {
  13. done();
  14. });
  15. });
  16. /**
  17. * This test highlights different ways of using asserts from chai so that you can chose the syntax
  18. * you prefer between should, expect, and assert.
  19. */
  20. describe('#ExponentOfTwo', () => {
  21. it('should be expoent of two', () => {
  22. var result : boolean = BABYLON.Tools.IsExponentOfTwo(2);
  23. expect(result).to.be.true;
  24. result = BABYLON.Tools.IsExponentOfTwo(4);
  25. result.should.be.true;
  26. result = BABYLON.Tools.IsExponentOfTwo(8);
  27. assert.isTrue(result);
  28. });
  29. it('should not be exponent of two', () => {
  30. var result : boolean = BABYLON.Tools.IsExponentOfTwo(3);
  31. expect(result).to.be.false;
  32. result = BABYLON.Tools.IsExponentOfTwo(6);
  33. result.should.be.false;
  34. result = BABYLON.Tools.IsExponentOfTwo(12);
  35. assert.isFalse(result);
  36. });
  37. });
  38. });