Skip to content

Commit

Permalink
Fix NEXT_SKIP_ISOLATE=1 log for testing (#65590)
Browse files Browse the repository at this point in the history
This log was firing even when the env var is specified. Now it only logs
when appropriate.
  • Loading branch information
Ethan-Arrowood committed May 10, 2024
1 parent 6487873 commit 26ad61a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/lib/next-modes/base.ts
Expand Up @@ -140,14 +140,16 @@ export class NextInstance {
if (this.isDestroyed) {
throw new Error('next instance already destroyed')
}
require('console').log(
`Creating test directory with isolated next... (use NEXT_SKIP_ISOLATE=1 to opt-out)`
)

await parentSpan
.traceChild('createTestDir')
.traceAsyncFn(async (rootSpan) => {
const skipIsolatedNext = !!process.env.NEXT_SKIP_ISOLATE
if (!skipIsolatedNext) {
require('console').log(
`Creating test directory with isolated next... (use NEXT_SKIP_ISOLATE=1 to opt-out)`
)
}
const tmpDir = skipIsolatedNext
? path.join(__dirname, '../../tmp')
: process.env.NEXT_TEST_DIR || (await fs.realpath(os.tmpdir()))
Expand Down

0 comments on commit 26ad61a

Please sign in to comment.