Skip to content

Commit

Permalink
fix failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianha committed Feb 5, 2024
1 parent 40bdcca commit 8d02440
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions test/e2e/prerender.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ describe('Prerender', () => {
expect(initialRes.headers.get('cache-control')).toBe(
isDeploy
? 'public, max-age=0, must-revalidate'
: 's-maxage=2, stale-while-revalidate'
: 's-maxage=2, stale-while-revalidate=31536000'
)
})
}
Expand Down Expand Up @@ -1265,7 +1265,7 @@ describe('Prerender', () => {
expect(initialRes.headers.get('cache-control')).toBe(
isDeploy
? 'public, max-age=0, must-revalidate'
: 's-maxage=31536000, stale-while-revalidate'
: 's-maxage=31536000, stale-while-revalidate=31536000'
)
const initialHtml = await initialRes.text()
expect(initialHtml).toMatch(/hello.*?world/)
Expand Down
12 changes: 6 additions & 6 deletions test/integration/not-found-revalidate/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const runTests = () => {

const props = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props.found).toBe(true)
Expand All @@ -114,7 +114,7 @@ const runTests = () => {

const props2 = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props2.found).toBe(true)
Expand All @@ -127,7 +127,7 @@ const runTests = () => {

const props3 = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props3.found).toBe(true)
Expand Down Expand Up @@ -157,7 +157,7 @@ const runTests = () => {

const props = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props.found).toBe(true)
Expand All @@ -170,7 +170,7 @@ const runTests = () => {

const props2 = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props2.found).toBe(true)
Expand All @@ -183,7 +183,7 @@ const runTests = () => {

const props3 = JSON.parse($('#props').text())
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
expect(res.status).toBe(200)
expect(props3.found).toBe(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('required server files i18n', () => {
})
expect(res.status).toBe(200)
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)

await waitFor(2000)
Expand All @@ -182,7 +182,7 @@ describe('required server files i18n', () => {
})
expect(res2.status).toBe(404)
expect(res2.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
})

Expand All @@ -194,7 +194,7 @@ describe('required server files i18n', () => {
})
expect(res.status).toBe(200)
expect(res.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)

await next.patchFile('standalone/data.txt', 'hide')
Expand All @@ -206,7 +206,7 @@ describe('required server files i18n', () => {

expect(res2.status).toBe(404)
expect(res2.headers.get('cache-control')).toBe(
's-maxage=1, stale-while-revalidate'
's-maxage=1, stale-while-revalidate=31536000'
)
})

Expand Down

0 comments on commit 8d02440

Please sign in to comment.