mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
These are now stable but to allow for graceful upgrading we still export unstable versions. The unstable version includes a once-warning that indicates you should upgrade to the stable name.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { isNextDev, nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('Cache Components Errors', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: __dirname + '/fixtures/unstable-deprecations',
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
describe('Deprecating `unstable` prefix for `cacheLife` and `cacheTag`', () => {
|
|
it('warns if you use `cacheLife` through `unstable_cacheLife`', async () => {
|
|
if (isNextDev) {
|
|
await next.browser('/life')
|
|
|
|
expect(next.cliOutput).toContain(
|
|
'Error: `unstable_cacheLife` was recently stabilized'
|
|
)
|
|
} else {
|
|
expect(next.cliOutput).toContain(
|
|
'Error: `unstable_cacheLife` was recently stabilized'
|
|
)
|
|
}
|
|
})
|
|
it('warns if you use `cacheTag` through `unstable_cacheTag`', async () => {
|
|
if (isNextDev) {
|
|
await next.browser('/tag')
|
|
|
|
expect(next.cliOutput).toContain(
|
|
'Error: `unstable_cacheTag` was recently stabilized'
|
|
)
|
|
} else {
|
|
expect(next.cliOutput).toContain(
|
|
'Error: `unstable_cacheTag` was recently stabilized'
|
|
)
|
|
}
|
|
})
|
|
})
|
|
})
|