mirror of https://github.com/vuejs/core.git
test(runtime-vapor): add unit test for config.performance (#234)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
parent
80acfa5030
commit
bc04592ca9
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue