File size: 743 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { PrefetchRSCPathnameNormalizer } from './prefetch-rsc'

describe('PrefetchRSCPathnameNormalizer', () => {
  const normalizer = new PrefetchRSCPathnameNormalizer()

  it('should match the prefetch rsc pathname', () => {
    expect(normalizer.match('/blog/post.prefetch.rsc')).toBe(true)
  })

  it('should not match the prefetch rsc pathname with a different suffix', () => {
    expect(normalizer.match('/blog/post.prefetch.rsc2')).toBe(false)
  })

  it('should normalize the prefetch rsc pathname', () => {
    expect(normalizer.normalize('/blog/post.prefetch.rsc')).toBe('/blog/post')
  })

  it('should normalize the prefetch rsc index pathname', () => {
    expect(normalizer.normalize('/__index.prefetch.rsc')).toBe('/')
  })
})