From f1c2e01f973f238cdfb54c77e59a08d056b9342c Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 8 Apr 2020 14:12:43 +0200 Subject: [PATCH] test: group tests --- __tests__/router.spec.ts | 85 ++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/__tests__/router.spec.ts b/__tests__/router.spec.ts index 085a89ae..ccfaf41e 100644 --- a/__tests__/router.spec.ts +++ b/__tests__/router.spec.ts @@ -501,52 +501,53 @@ describe('Router', () => { }) }) - it('allows base option in abstract history', async () => { - const history = createMemoryHistory('/app/') - const router = createRouter({ history, routes }) - expect(router.currentRoute.value).toMatchObject({ - name: undefined, - fullPath: '/', - hash: '', - params: {}, - path: '/', - query: {}, - meta: {}, - }) - await router.replace('/foo') - expect(router.currentRoute.value).toMatchObject({ - name: 'Foo', - fullPath: '/foo', - hash: '', - params: {}, - path: '/foo', - query: {}, + describe('base', () => { + it('allows base option in abstract history', async () => { + const history = createMemoryHistory('/app/') + const router = createRouter({ history, routes }) + expect(router.currentRoute.value).toMatchObject({ + name: undefined, + fullPath: '/', + hash: '', + params: {}, + path: '/', + query: {}, + meta: {}, + }) + await router.replace('/foo') + expect(router.currentRoute.value).toMatchObject({ + name: 'Foo', + fullPath: '/foo', + hash: '', + params: {}, + path: '/foo', + query: {}, + }) }) - }) - it('allows base option with html5 history', async () => { - const history = createWebHistory('/app/') - const router = createRouter({ history, routes }) - expect(router.currentRoute.value).toMatchObject({ - name: undefined, - fullPath: '/', - hash: '', - params: {}, - path: '/', - query: {}, - meta: {}, - }) - await router.replace('/foo') - expect(router.currentRoute.value).toMatchObject({ - name: 'Foo', - fullPath: '/foo', - hash: '', - params: {}, - path: '/foo', - query: {}, + it('allows base option with html5 history', async () => { + const history = createWebHistory('/app/') + const router = createRouter({ history, routes }) + expect(router.currentRoute.value).toMatchObject({ + name: undefined, + fullPath: '/', + hash: '', + params: {}, + path: '/', + query: {}, + meta: {}, + }) + await router.replace('/foo') + expect(router.currentRoute.value).toMatchObject({ + name: 'Foo', + fullPath: '/foo', + hash: '', + params: {}, + path: '/foo', + query: {}, + }) }) }) - describe('Dynamic Routing', () => { it('resolves new added routes', async () => { const { router } = await newRouter() -- 2.39.5