update tests for deploy

parent e9ffd9be
...@@ -43,12 +43,12 @@ describe('Switchable runtime', () => { ...@@ -43,12 +43,12 @@ describe('Switchable runtime', () => {
app: new FileRef(join(__dirname, './app')), app: new FileRef(join(__dirname, './app')),
pages: new FileRef(join(__dirname, './pages')), pages: new FileRef(join(__dirname, './pages')),
utils: new FileRef(join(__dirname, './utils')), utils: new FileRef(join(__dirname, './utils')),
'next.config.js': new FileRef(join(__dirname, './next.config.js')),
}, },
dependencies: { dependencies: {
react: 'experimental', react: 'experimental',
'react-dom': 'experimental', 'react-dom': 'experimental',
}, },
nextConfig: new FileRef(join(__dirname, './next.config.js')),
}) })
context = { context = {
appPort: next.url, appPort: next.url,
...@@ -120,24 +120,26 @@ describe('Switchable runtime', () => { ...@@ -120,24 +120,26 @@ describe('Switchable runtime', () => {
const text = await response.text() const text = await response.text()
expect(text).toMatch(/Hello from .+\/api\/hello/) expect(text).toMatch(/Hello from .+\/api\/hello/)
const manifest = await readJson( if (!(global as any).isNextDeploy) {
join(context.appDir, '.next/server/middleware-manifest.json') const manifest = await readJson(
) join(context.appDir, '.next/server/middleware-manifest.json')
expect(manifest).toMatchObject({ )
functions: { expect(manifest).toMatchObject({
'/api/hello': { functions: {
env: [], '/api/hello': {
files: [ env: [],
'server/edge-runtime-webpack.js', files: [
'server/pages/api/hello.js', 'server/edge-runtime-webpack.js',
], 'server/pages/api/hello.js',
name: 'pages/api/hello', ],
page: '/api/hello', name: 'pages/api/hello',
regexp: '^/api/hello$', page: '/api/hello',
wasm: [], regexp: '^/api/hello$',
wasm: [],
},
}, },
}, })
}) }
}) })
}) })
} else { } else {
...@@ -238,24 +240,26 @@ describe('Switchable runtime', () => { ...@@ -238,24 +240,26 @@ describe('Switchable runtime', () => {
const text = await response.text() const text = await response.text()
expect(text).toMatch(/Hello from .+\/api\/hello/) expect(text).toMatch(/Hello from .+\/api\/hello/)
const manifest = await readJson( if (!(global as any).isNextDeploy) {
join(context.appDir, '.next/server/middleware-manifest.json') const manifest = await readJson(
) join(context.appDir, '.next/server/middleware-manifest.json')
expect(manifest).toMatchObject({ )
functions: { expect(manifest).toMatchObject({
'/api/hello': { functions: {
env: [], '/api/hello': {
files: [ env: [],
'server/edge-runtime-webpack.js', files: [
'server/pages/api/hello.js', 'server/edge-runtime-webpack.js',
], 'server/pages/api/hello.js',
name: 'pages/api/hello', ],
page: '/api/hello', name: 'pages/api/hello',
regexp: '^/api/hello$', page: '/api/hello',
wasm: [], regexp: '^/api/hello$',
wasm: [],
},
}, },
}, })
}) }
}) })
it.skip('should display correct tree view with page types in terminal', async () => { it.skip('should display correct tree view with page types in terminal', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment