Skip to content

Commit

Permalink
fix: Missing cleanup calls in WebXR test
Browse files Browse the repository at this point in the history
  • Loading branch information
heysokam committed Oct 10, 2024
1 parent 116363f commit 41c1537
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/xr.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { mockEngineRenderer } from '@ir-engine/spatial/tests/util/MockEngineRenderer'
import { createEngine, destroyEngine } from '@ir-engine/ecs/src/Engine'
import { initializeSpatialEngine, initializeSpatialViewer } from '@ir-engine/spatial/src/initializeEngine'
import {
destroySpatialEngine,
destroySpatialViewer,
initializeSpatialEngine,
initializeSpatialViewer
} from '@ir-engine/spatial/src/initializeEngine'
import { requestXRSession } from '@ir-engine/spatial/src/xr/XRSessionFunctions'
import { describe, it, beforeEach, afterEach, assert, beforeAll } from 'vitest'
import { WebXREventDispatcher } from '../webxr-emulator/WebXREventDispatcher'
Expand Down Expand Up @@ -54,7 +59,7 @@ describe('WebXR', () => {
initializeSpatialEngine()
initializeSpatialViewer()

const timer = Timer((time, xrFrame) => {
const timer = Timer((_time, xrFrame) => {
getMutableState(XRState).xrFrame.set(xrFrame)
// executeSystems(time)
getMutableState(XRState).xrFrame.set(null)
Expand All @@ -67,7 +72,9 @@ describe('WebXR', () => {
})

afterEach(async () => {
await destroyEngine()
destroySpatialViewer()
destroySpatialEngine()
return await destroyEngine()
})

it('can define and initialize a device', async () => {
Expand Down

0 comments on commit 41c1537

Please sign in to comment.