Skip to content

Commit

Permalink
bump to 0.2.1
Browse files Browse the repository at this point in the history
add test for scene parsing
  • Loading branch information
plepers committed Mar 28, 2024
1 parent 614a0ec commit 222775d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nanogl-gltf",
"version": "0.2.0",
"version": "0.2.1",
"description": "gltf loader",
"scripts": {
"test": "karma start",
Expand Down
46 changes: 46 additions & 0 deletions test/scene_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import expect from 'expect.js';
import Gltf from '../src/Gltf';
import WebGltfIO from '../src/io/web';
import GltfTypes from '../src/types/GltfTypes';


describe("Animation Sampler", function () {

let gltf :Gltf;

before(function () {
return WebGltfIO.loadGltf('samples/other/khronos/lights.gltf').then( res=>gltf=res )
});



describe("scene access", function () {

it("with getElement", function () {
expect( gltf.getElement( GltfTypes.SCENE, 0 ) ).to.be.ok()
})

it("with scenes", function () {
expect( gltf.scenes.length ).to.be(1)
})

})

describe("scene is ok", function () {


it("scene name is set", function () {
expect( gltf.scenes[0].name ).to.be("scene")
});

it("scene has 3 nodes", function () {
expect( gltf.scenes[0].nodes.length ).to.be(3)
});

it("scene second node is ok", function () {
expect( gltf.scenes[0].nodes[1].name ).to.be("directional_light")
});

});

});

0 comments on commit 222775d

Please # to comment.