Unverified Commit ebc1b0e5 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Fix missing trace items and migrate required files test (#29649)

parent dffcfe82
...@@ -307,12 +307,6 @@ export class TraceEntryPointsPlugin implements webpack.Plugin { ...@@ -307,12 +307,6 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
continue continue
} }
const filepath = nodePath.join(root, file) const filepath = nodePath.join(root, file)
// don't include transpiled files as they are included
// in the webpack output (e.g. chunks or the entry itself)
if (depModMap.get(filepath)?.originalSource?.()) {
continue
}
tracedDeps.push(filepath) tracedDeps.push(filepath)
} }
......
...@@ -118,6 +118,8 @@ describe('Production Usage', () => { ...@@ -118,6 +118,8 @@ describe('Production Usage', () => {
/node_modules\/react\/index\.js/, /node_modules\/react\/index\.js/,
/node_modules\/react\/package\.json/, /node_modules\/react\/package\.json/,
/node_modules\/react\/cjs\/react\.production\.min\.js/, /node_modules\/react\/cjs\/react\.production\.min\.js/,
/next\/link\.js/,
/next\/dist\/client\/link\.js/,
], ],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/], notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
}, },
...@@ -129,6 +131,8 @@ describe('Production Usage', () => { ...@@ -129,6 +131,8 @@ describe('Production Usage', () => {
/node_modules\/react\/index\.js/, /node_modules\/react\/index\.js/,
/node_modules\/react\/package\.json/, /node_modules\/react\/package\.json/,
/node_modules\/react\/cjs\/react\.production\.min\.js/, /node_modules\/react\/cjs\/react\.production\.min\.js/,
/next\/router\.js/,
/next\/dist\/client\/router\.js/,
], ],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/], notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
}, },
......
module.exports = {
// ensure incorrect target is overridden by env
target: 'serverless',
experimental: {
outputFileTracing: true,
},
eslint: {
ignoreDuringBuilds: true,
},
rewrites() {
return [
{
source: '/some-catch-all/:path*',
destination: '/',
},
]
},
}
...@@ -16,7 +16,7 @@ export class NextInstance { ...@@ -16,7 +16,7 @@ export class NextInstance {
protected nextConfig?: NextConfig protected nextConfig?: NextConfig
protected dependencies?: { [name: string]: string } protected dependencies?: { [name: string]: string }
protected events: { [eventName: string]: Set<any> } protected events: { [eventName: string]: Set<any> }
protected testDir: string public testDir: string
protected isStopping: boolean protected isStopping: boolean
protected isDestroyed: boolean protected isDestroyed: boolean
protected childProcess: ChildProcess protected childProcess: ChildProcess
...@@ -156,7 +156,10 @@ export class NextInstance { ...@@ -156,7 +156,10 @@ export class NextInstance {
this.isDestroyed = true this.isDestroyed = true
this.emit('destroy', []) this.emit('destroy', [])
await this.stop() await this.stop()
await fs.remove(this.testDir)
if (!process.env.NEXT_TEST_SKIP_CLEANUP) {
await fs.remove(this.testDir)
}
} }
public get url() { public get url() {
......
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import Link from 'next/link'
import getConfig from '../lib/config' import getConfig from '../lib/config'
const localConfig = getConfig() const localConfig = getConfig()
...@@ -23,6 +24,9 @@ export default function Page(props) { ...@@ -23,6 +24,9 @@ export default function Page(props) {
<p id="index">index page</p> <p id="index">index page</p>
<p id="router">{JSON.stringify(router)}</p> <p id="router">{JSON.stringify(router)}</p>
<p id="props">{JSON.stringify(props)}</p> <p id="props">{JSON.stringify(props)}</p>
<Link href="gsp">
<a>to /gsp</a>
</Link>
</> </>
) )
} }
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