Skip to content

Commit fd3a2af

Browse files
committedJul 7, 2022
update tests for deploy
1 parent e9ffd9b commit fd3a2af

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed
 

‎test/e2e/switchable-runtime/index.test.ts

+39-35
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ describe('Switchable runtime', () => {
4343
app: new FileRef(join(__dirname, './app')),
4444
pages: new FileRef(join(__dirname, './pages')),
4545
utils: new FileRef(join(__dirname, './utils')),
46+
'next.config.js': new FileRef(join(__dirname, './next.config.js')),
4647
},
4748
dependencies: {
4849
react: 'experimental',
4950
'react-dom': 'experimental',
5051
},
51-
nextConfig: new FileRef(join(__dirname, './next.config.js')),
5252
})
5353
context = {
5454
appPort: next.url,
@@ -120,24 +120,26 @@ describe('Switchable runtime', () => {
120120
const text = await response.text()
121121
expect(text).toMatch(/Hello from .+\/api\/hello/)
122122

123-
const manifest = await readJson(
124-
join(context.appDir, '.next/server/middleware-manifest.json')
125-
)
126-
expect(manifest).toMatchObject({
127-
functions: {
128-
'/api/hello': {
129-
env: [],
130-
files: [
131-
'server/edge-runtime-webpack.js',
132-
'server/pages/api/hello.js',
133-
],
134-
name: 'pages/api/hello',
135-
page: '/api/hello',
136-
regexp: '^/api/hello$',
137-
wasm: [],
123+
if (!(global as any).isNextDeploy) {
124+
const manifest = await readJson(
125+
join(context.appDir, '.next/server/middleware-manifest.json')
126+
)
127+
expect(manifest).toMatchObject({
128+
functions: {
129+
'/api/hello': {
130+
env: [],
131+
files: [
132+
'server/edge-runtime-webpack.js',
133+
'server/pages/api/hello.js',
134+
],
135+
name: 'pages/api/hello',
136+
page: '/api/hello',
137+
regexp: '^/api/hello$',
138+
wasm: [],
139+
},
138140
},
139-
},
140-
})
141+
})
142+
}
141143
})
142144
})
143145
} else {
@@ -238,24 +240,26 @@ describe('Switchable runtime', () => {
238240
const text = await response.text()
239241
expect(text).toMatch(/Hello from .+\/api\/hello/)
240242

241-
const manifest = await readJson(
242-
join(context.appDir, '.next/server/middleware-manifest.json')
243-
)
244-
expect(manifest).toMatchObject({
245-
functions: {
246-
'/api/hello': {
247-
env: [],
248-
files: [
249-
'server/edge-runtime-webpack.js',
250-
'server/pages/api/hello.js',
251-
],
252-
name: 'pages/api/hello',
253-
page: '/api/hello',
254-
regexp: '^/api/hello$',
255-
wasm: [],
243+
if (!(global as any).isNextDeploy) {
244+
const manifest = await readJson(
245+
join(context.appDir, '.next/server/middleware-manifest.json')
246+
)
247+
expect(manifest).toMatchObject({
248+
functions: {
249+
'/api/hello': {
250+
env: [],
251+
files: [
252+
'server/edge-runtime-webpack.js',
253+
'server/pages/api/hello.js',
254+
],
255+
name: 'pages/api/hello',
256+
page: '/api/hello',
257+
regexp: '^/api/hello$',
258+
wasm: [],
259+
},
256260
},
257-
},
258-
})
261+
})
262+
}
259263
})
260264

261265
it.skip('should display correct tree view with page types in terminal', async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.