@@ -98,66 +98,60 @@ const runTests = (isDev = false) => {
98
98
}
99
99
}
100
100
101
- describe ( 'AMP SSG Support' , ( ) => {
102
- ; ( process . env . TURBOPACK_DEV ? describe . skip : describe ) (
103
- 'production mode' ,
104
- ( ) => {
101
+ // Turbopack does not support AMP rendering.
102
+ ; ( process . env . TURBOPACK ? describe . skip : describe ) ( 'AMP SSG Support' , ( ) => {
103
+ describe ( 'production mode' , ( ) => {
104
+ beforeAll ( async ( ) => {
105
+ await nextBuild ( appDir )
106
+ appPort = await findPort ( )
107
+ app = await nextStart ( appDir , appPort )
108
+ // TODO: use browser instead to do checks that now need filesystem access
109
+ builtServerPagesDir = join ( appDir , '.next' , 'server' , 'pages' )
110
+ } )
111
+ afterAll ( ( ) => killApp ( app ) )
112
+ runTests ( )
113
+ } )
114
+
115
+ describe ( 'development mode' , ( ) => {
116
+ beforeAll ( async ( ) => {
117
+ appPort = await findPort ( )
118
+ app = await launchApp ( appDir , appPort )
119
+ } )
120
+ afterAll ( ( ) => killApp ( app ) )
121
+ runTests ( true )
122
+ } )
123
+
124
+ describe ( 'export mode' , ( ) => {
125
+ describe ( 'production mode' , ( ) => {
126
+ let buildId
127
+
105
128
beforeAll ( async ( ) => {
129
+ nextConfig . write ( `module.exports = { output: 'export' }` )
106
130
await nextBuild ( appDir )
107
- appPort = await findPort ( )
108
- app = await nextStart ( appDir , appPort )
109
- // TODO: use browser instead to do checks that now need filesystem access
110
- builtServerPagesDir = join ( appDir , '.next' , 'server' , 'pages' )
131
+ buildId = await fs . readFile ( join ( appDir , '.next/BUILD_ID' ) , 'utf8' )
111
132
} )
112
- afterAll ( ( ) => killApp ( app ) )
113
- runTests ( )
114
- }
115
- )
116
- ; ( process . env . TURBOPACK_BUILD ? describe . skip : describe ) (
117
- 'development mode' ,
118
- ( ) => {
119
- beforeAll ( async ( ) => {
120
- appPort = await findPort ( )
121
- app = await launchApp ( appDir , appPort )
133
+
134
+ afterAll ( ( ) => nextConfig . delete ( ) )
135
+
136
+ it ( 'should have copied SSG files correctly' , async ( ) => {
137
+ const outFile = ( file ) => join ( appDir , 'out' , file )
138
+
139
+ expect ( await fsExists ( outFile ( 'amp.html' ) ) ) . toBe ( true )
140
+ expect ( await fsExists ( outFile ( 'index.html' ) ) ) . toBe ( true )
141
+ expect ( await fsExists ( outFile ( 'hybrid.html' ) ) ) . toBe ( true )
142
+ expect ( await fsExists ( outFile ( 'amp.amp.html' ) ) ) . toBe ( false )
143
+ expect ( await fsExists ( outFile ( 'hybrid.amp.html' ) ) ) . toBe ( true )
144
+ expect ( await fsExists ( outFile ( 'blog/post-1.html' ) ) ) . toBe ( true )
145
+ expect ( await fsExists ( outFile ( 'blog/post-1.amp.html' ) ) ) . toBe ( true )
146
+
147
+ expect (
148
+ await fsExists ( outFile ( join ( '_next/data' , buildId , 'amp.json' ) ) )
149
+ ) . toBe ( true )
150
+
151
+ expect (
152
+ await fsExists ( outFile ( join ( '_next/data' , buildId , 'hybrid.json' ) ) )
153
+ ) . toBe ( true )
122
154
} )
123
- afterAll ( ( ) => killApp ( app ) )
124
- runTests ( true )
125
- }
126
- )
127
- describe ( 'export mode' , ( ) => {
128
- ; ( process . env . TURBOPACK_DEV ? describe . skip : describe ) (
129
- 'production mode' ,
130
- ( ) => {
131
- let buildId
132
-
133
- beforeAll ( async ( ) => {
134
- nextConfig . write ( `module.exports = { output: 'export' }` )
135
- await nextBuild ( appDir )
136
- buildId = await fs . readFile ( join ( appDir , '.next/BUILD_ID' ) , 'utf8' )
137
- } )
138
-
139
- afterAll ( ( ) => nextConfig . delete ( ) )
140
-
141
- it ( 'should have copied SSG files correctly' , async ( ) => {
142
- const outFile = ( file ) => join ( appDir , 'out' , file )
143
-
144
- expect ( await fsExists ( outFile ( 'amp.html' ) ) ) . toBe ( true )
145
- expect ( await fsExists ( outFile ( 'index.html' ) ) ) . toBe ( true )
146
- expect ( await fsExists ( outFile ( 'hybrid.html' ) ) ) . toBe ( true )
147
- expect ( await fsExists ( outFile ( 'amp.amp.html' ) ) ) . toBe ( false )
148
- expect ( await fsExists ( outFile ( 'hybrid.amp.html' ) ) ) . toBe ( true )
149
- expect ( await fsExists ( outFile ( 'blog/post-1.html' ) ) ) . toBe ( true )
150
- expect ( await fsExists ( outFile ( 'blog/post-1.amp.html' ) ) ) . toBe ( true )
151
-
152
- expect (
153
- await fsExists ( outFile ( join ( '_next/data' , buildId , 'amp.json' ) ) )
154
- ) . toBe ( true )
155
-
156
- expect (
157
- await fsExists ( outFile ( join ( '_next/data' , buildId , 'hybrid.json' ) ) )
158
- ) . toBe ( true )
159
- } )
160
- }
161
- )
155
+ } )
162
156
} )
163
157
} )
0 commit comments