Skip to content

Commit

Permalink
Cache headers are not set in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AriFreyr committed Jan 11, 2021
1 parent 91192e5 commit 75357d6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/integration/prerender/test/index.test.js
Expand Up @@ -520,13 +520,15 @@ const runTests = (dev = false, isEmulatedServerless = false) => {
)
expect(data.pageProps.post).toBe('post-3')
})

it('should use correct caching headers for a revalidate page', async () => {
const initialRes = await fetchViaHTTP(appPort, '/')
expect(initialRes.headers.get('cache-control')).toBe(
's-maxage=2, stale-while-revalidate'
)
})

if (!dev) {
it('should use correct caching headers for a revalidate page', async () => {
const initialRes = await fetchViaHTTP(appPort, '/')
expect(initialRes.headers.get('cache-control')).toBe(
's-maxage=2, stale-while-revalidate'
)
})
}

it('should navigate to a normal page and back', async () => {
const browser = await webdriver(appPort, '/')
Expand Down

0 comments on commit 75357d6

Please sign in to comment.