From: Eduardo San Martin Morote Date: Wed, 8 Apr 2020 12:12:43 +0000 (+0200) Subject: test: group tests X-Git-Tag: v4.0.0-alpha.6~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1c2e01f973f238cdfb54c77e59a08d056b9342c;p=thirdparty%2Fvuejs%2Frouter.git test: group tests --- 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()