xrfragment/test/aframe/index.js

24 lines
605 B
JavaScript
Raw Normal View History

2023-11-08 18:28:18 +01:00
// in the browser use this instead of require():
//
// <script src="dist/xrfragment.js"></script>
// <script>
// var XRF = xrfragment;
// </script>
console.assert = ((assert) => (a,b) => {
2023-11-17 16:34:11 +01:00
console.log("\x1b[34m♥ \x1b[36;49mtest: "+b.reason+"\x1B[m")
2023-11-08 18:28:18 +01:00
assert.call( console, a, b )
})(console.assert)
/*
* parser checks
*/
2024-04-16 15:19:08 +02:00
let frags = xrf.URI.parse('://foo.com/1.gltf#pos=1.0,2.0,3.0&t=0,100').XRF
2023-11-08 18:28:18 +01:00
console.assert( frags.t, {frags, reason:'URI.parse(): t needs to be set'})
2024-04-16 15:19:08 +02:00
let frag = xrf.URI.parse("#foo=1").XRF
2023-11-16 14:50:57 +01:00
console.assert( frag, {reason: 'xrf.URI.parse() should be available'})
2023-11-08 18:28:18 +01:00