]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: group tests
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Apr 2020 12:12:43 +0000 (14:12 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 8 Apr 2020 12:12:43 +0000 (14:12 +0200)
__tests__/router.spec.ts

index 085a89ae7f87bc74831107cff05169a331bafcaa..ccfaf41e05d6b1b22e6878cb0ecf4780005fe145 100644 (file)
@@ -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()