Skip to content

Commit

Permalink
add: more details to test output (failing on CI only)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzinn committed Sep 1, 2022
1 parent 194da3d commit 81db578
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions packages/react-babylonjs/test/render.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,15 @@ describe(' > Reconciler/Render tests', function testSuite() {
null
)

assert.ok(container.scene !== null, 'scene should be non-null')
const box: AbstractMesh | undefined = container.scene.meshes.find((m) => m.name === 'box')
assert.ok(box !== undefined)
assert.ok(
box !== undefined,
`Expected to find 'box', but found only '${container.scene.meshes
.map((m) => m.name)
.join(',')}'`
)
assert.ok(box.material !== null, 'Box material should be non-null')
assert.strictEqual('boxMat', box.material.name)
})

Expand Down Expand Up @@ -166,8 +173,15 @@ describe(' > Reconciler/Render tests', function testSuite() {
null
)

assert.ok(container.scene !== null, 'scene should be non-null')

const camera: Camera | undefined = container.scene.cameras.find((c) => c.name === 'camera1')
assert.ok(camera !== undefined)
assert.ok(
camera !== undefined,
`Camera 'camera1' should be defined. Found: '${container.scene.cameras
.map((c) => c.name)
.join(',')}'`
)
assert.ok(camera instanceof ArcRotateCamera, 'Should be ArcRotateCamera')
assert.ok(Vector3.Up().equals(camera.target), 'should be the same as Vector3.Up')
})
Expand Down Expand Up @@ -207,8 +221,12 @@ describe(' > Reconciler/Render tests', function testSuite() {
null
)

assert.ok(container.scene !== null, 'scene should be non-null')
const box: AbstractMesh | undefined = container.scene.meshes.find((m) => m.name === 'box')
assert.ok(box !== undefined)
assert.ok(
box !== undefined,
`box should be found: '${container.scene.meshes.map((m) => m.name).join(',')}'`
)

const effectLayers: EffectLayer[] = container.scene.effectLayers
assert.strictEqual(1, effectLayers.length, 'glow layer should be part of scene')
Expand Down

0 comments on commit 81db578

Please sign in to comment.