File size: 648 Bytes
b91e262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { nextTestSetup } from 'e2e-utils'

describe('experimental.devCacheControlNoCache', () => {
  describe('when enabled', () => {
    const { next } = nextTestSetup({
      files: __dirname,
    })

    it('should use no-cache instead of no-store for pages router', async () => {
      const res = await next.fetch('/pages-route')
      expect(res.headers.get('Cache-Control')).toBe('no-cache, must-revalidate')
    })

    it('should use no-cache instead of no-store for app router', async () => {
      const res = await next.fetch('/app-route')
      expect(res.headers.get('Cache-Control')).toBe('no-cache, must-revalidate')
    })
  })
})