File tree Expand file tree Collapse file tree 6 files changed +77
-0
lines changed
test/e2e/deprecation-warnings Expand file tree Collapse file tree 6 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ import { nextTestSetup } from 'e2e-utils'
2+ import path from 'path'
3+
4+ describe ( 'deprecation-warnings' , ( ) => {
5+ describe ( 'without next.config.js' , ( ) => {
6+ const { next } = nextTestSetup ( {
7+ files : path . join ( __dirname , 'fixtures/no-config' ) ,
8+ skipStart : true ,
9+ } )
10+
11+ it ( 'should not emit any deprecation warnings when no config file exists' , async ( ) => {
12+ await next . start ( )
13+
14+ const logs = next . cliOutput
15+ expect ( logs ) . not . toContain ( 'deprecated' )
16+ expect ( logs ) . not . toContain ( 'has been renamed' )
17+ expect ( logs ) . not . toContain ( 'no longer needed' )
18+ } )
19+ } )
20+
21+ describe ( 'with deprecated config options' , ( ) => {
22+ const { next } = nextTestSetup ( {
23+ files : path . join ( __dirname , 'fixtures/with-deprecated-config' ) ,
24+ skipStart : true ,
25+ } )
26+
27+ it ( 'should emit deprecation warnings for explicitly configured deprecated options' , async ( ) => {
28+ await next . start ( )
29+
30+ const logs = next . cliOutput
31+
32+ // Should warn about amp configuration
33+ expect ( logs ) . toContain ( 'Built-in amp support is deprecated' )
34+
35+ // Should warn about experimental.instrumentationHook
36+ expect ( logs ) . toContain ( 'experimental.instrumentationHook' )
37+ expect ( logs ) . toContain ( 'no longer needed' )
38+ } )
39+ } )
40+ } )
Original file line number Diff line number Diff line change 1+ export default function RootLayout ( {
2+ children,
3+ } : {
4+ children : React . ReactNode
5+ } ) {
6+ return (
7+ < html lang = "en" >
8+ < body > { children } </ body >
9+ </ html >
10+ )
11+ }
Original file line number Diff line number Diff line change 1+ export default function Page ( ) {
2+ return < div > Hello World</ div >
3+ }
Original file line number Diff line number Diff line change 1+ export default function RootLayout ( {
2+ children,
3+ } : {
4+ children : React . ReactNode
5+ } ) {
6+ return (
7+ < html lang = "en" >
8+ < body > { children } </ body >
9+ </ html >
10+ )
11+ }
Original file line number Diff line number Diff line change 1+ export default function Page ( ) {
2+ return < div > Hello World</ div >
3+ }
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ // Explicitly configure deprecated options
3+ amp : {
4+ canonicalBase : 'https://example.com' ,
5+ } ,
6+ experimental : {
7+ instrumentationHook : true ,
8+ } ,
9+ }
You can’t perform that action at this time.
0 commit comments