File size: 544 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { createRouterCacheKey } from './create-router-cache-key'

describe('createRouterCacheKey', () => {
  it('should support string segment', () => {
    expect(createRouterCacheKey('foo')).toEqual('foo')
  })

  it('should support dynamic segment', () => {
    expect(createRouterCacheKey(['slug', 'hello-world', 'd'])).toEqual(
      'slug|hello-world|d'
    )
  })

  it('should support catch all segment', () => {
    expect(createRouterCacheKey(['slug', 'blog/hello-world', 'c'])).toEqual(
      'slug|blog/hello-world|c'
    )
  })
})