Skip to content

Commit

Permalink
test(runtime-vapor): add unit test for config.performance (#234)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
  • Loading branch information
xiaodong2008 and sxzz authored Jun 17, 2024
1 parent 80acfa5 commit bc04592
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,26 @@ describe('api: createVaporApp', () => {
).toHaveBeenWarned()
})
})

describe('config.performance', () => {
afterEach(() => {
window.performance.clearMeasures()
})

test('with performance enabled', () => {
const { app, mount } = define({}).create()

app.config.performance = true
mount()
expect(window.performance.getEntries()).lengthOf(2)
})

test('with performance disabled', () => {
const { app, mount } = define({}).create()

app.config.performance = false
mount()
expect(window.performance.getEntries()).lengthOf(0)
})
})
})

0 comments on commit bc04592

Please sign in to comment.