Skip to content

Commit bc04592

Browse files
xiaodong2008sxzz
andauthored
test(runtime-vapor): add unit test for config.performance (#234)
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
1 parent 80acfa5 commit bc04592

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts

+22
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,26 @@ describe('api: createVaporApp', () => {
310310
).toHaveBeenWarned()
311311
})
312312
})
313+
314+
describe('config.performance', () => {
315+
afterEach(() => {
316+
window.performance.clearMeasures()
317+
})
318+
319+
test('with performance enabled', () => {
320+
const { app, mount } = define({}).create()
321+
322+
app.config.performance = true
323+
mount()
324+
expect(window.performance.getEntries()).lengthOf(2)
325+
})
326+
327+
test('with performance disabled', () => {
328+
const { app, mount } = define({}).create()
329+
330+
app.config.performance = false
331+
mount()
332+
expect(window.performance.getEntries()).lengthOf(0)
333+
})
334+
})
313335
})

0 commit comments

Comments
 (0)