LoaderUtils.tests.js 807 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @author Don McCurdy / https://www.donmccurdy.com
  3. */
  4. /* global QUnit */
  5. import { LoaderUtils } from '../../../../src/loaders/LoaderUtils';
  6. export default QUnit.module( 'Loaders', () => {
  7. QUnit.module( 'LoaderUtils', () => {
  8. // INSTANCING
  9. QUnit.test( 'decodeText', ( assert ) => {
  10. var jsonArray = new Uint8Array( [ 123, 34, 106, 115, 111, 110, 34, 58, 32, 116, 114, 117, 101, 125 ] );
  11. assert.equal( '{"json": true}', LoaderUtils.decodeText( jsonArray ) );
  12. var multibyteArray = new Uint8Array( [ 230, 151, 165, 230, 156, 172, 229, 155, 189 ] );
  13. assert.equal( '日本国', LoaderUtils.decodeText( multibyteArray ) );
  14. } );
  15. QUnit.test( 'extractUrlBase', ( assert ) => {
  16. assert.equal( '/path/to/', LoaderUtils.extractUrlBase( '/path/to/model.glb' ) );
  17. } );
  18. } );
  19. } );