Skip to content

Commit

Permalink
Merge branch 'canary' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagomorales committed Jul 7, 2022
2 parents ab7255a + fd3a2af commit 4290352
Showing 1 changed file with 39 additions and 35 deletions.
74 changes: 39 additions & 35 deletions test/e2e/switchable-runtime/index.test.ts
Expand Up @@ -43,12 +43,12 @@ describe('Switchable runtime', () => {
app: new FileRef(join(__dirname, './app')),
pages: new FileRef(join(__dirname, './pages')),
utils: new FileRef(join(__dirname, './utils')),
'next.config.js': new FileRef(join(__dirname, './next.config.js')),
},
dependencies: {
react: 'experimental',
'react-dom': 'experimental',
},
nextConfig: new FileRef(join(__dirname, './next.config.js')),
})
context = {
appPort: next.url,
Expand Down Expand Up @@ -120,24 +120,26 @@ describe('Switchable runtime', () => {
const text = await response.text()
expect(text).toMatch(/Hello from .+\/api\/hello/)

const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
expect(manifest).toMatchObject({
functions: {
'/api/hello': {
env: [],
files: [
'server/edge-runtime-webpack.js',
'server/pages/api/hello.js',
],
name: 'pages/api/hello',
page: '/api/hello',
regexp: '^/api/hello$',
wasm: [],
if (!(global as any).isNextDeploy) {
const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
expect(manifest).toMatchObject({
functions: {
'/api/hello': {
env: [],
files: [
'server/edge-runtime-webpack.js',
'server/pages/api/hello.js',
],
name: 'pages/api/hello',
page: '/api/hello',
regexp: '^/api/hello$',
wasm: [],
},
},
},
})
})
}
})
})
} else {
Expand Down Expand Up @@ -238,24 +240,26 @@ describe('Switchable runtime', () => {
const text = await response.text()
expect(text).toMatch(/Hello from .+\/api\/hello/)

const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
expect(manifest).toMatchObject({
functions: {
'/api/hello': {
env: [],
files: [
'server/edge-runtime-webpack.js',
'server/pages/api/hello.js',
],
name: 'pages/api/hello',
page: '/api/hello',
regexp: '^/api/hello$',
wasm: [],
if (!(global as any).isNextDeploy) {
const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
expect(manifest).toMatchObject({
functions: {
'/api/hello': {
env: [],
files: [
'server/edge-runtime-webpack.js',
'server/pages/api/hello.js',
],
name: 'pages/api/hello',
page: '/api/hello',
regexp: '^/api/hello$',
wasm: [],
},
},
},
})
})
}
})

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

0 comments on commit 4290352

Please sign in to comment.