Skip to content

Commit

Permalink
Fix next.config.js overwriting on deploy e2e test (#39476)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Aug 10, 2022
1 parent bd61406 commit 1669c60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib/next-modes/base.ts
Expand Up @@ -178,10 +178,14 @@ export class NextInstance {
}
}

const nextConfigFile = Object.keys(this.files).find((file) =>
let nextConfigFile = Object.keys(this.files).find((file) =>
file.startsWith('next.config.')
)

if (await fs.pathExists(path.join(this.testDir, 'next.config.js'))) {
nextConfigFile = 'next.config.js'
}

if (nextConfigFile && this.nextConfig) {
throw new Error(
`nextConfig provided on "createNext()" and as a file "${nextConfigFile}", use one or the other to continue`
Expand Down

0 comments on commit 1669c60

Please sign in to comment.