Skip to content

Commit

Permalink
ensure test files are populated in next deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojude committed Feb 13, 2025
1 parent d9b27c9 commit 395bef6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/lib/next-modes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class NextInstance {
recursive: true,
})
} else {
const { tmpRepoDir } = await createNextInstall({
const { installDir, tmpRepoDir } = await createNextInstall({
parentSpan: rootSpan,
dependencies: finalDependencies,
resolutions: this.resolutions ?? null,
Expand All @@ -263,11 +263,26 @@ export class NextInstance {
})
},
})
this.testDir = installDir
this.tmpRepoDir = tmpRepoDir
}
require('console').log('created next.js install, writing test files')
}

if (isNextDeploy) {
await rootSpan
.traceChild('writeInitialFiles')
.traceAsyncFn(async () => {
await this.writeInitialFiles()
})

await await rootSpan
.traceChild('writeOverrideFiles')
.traceAsyncFn(async () => {
await this.writeOverrideFiles()
})
}

const testDirFiles = await fs.readdir(this.testDir)

let nextConfigFile = testDirFiles.find((file) =>
Expand Down

0 comments on commit 395bef6

Please sign in to comment.