Skip to content

Commit

Permalink
Fix swc test path from node_modules (#66047)
Browse files Browse the repository at this point in the history
Noticed while testing turbopack version of tests that we weren't loading
the correct swc binary since this path wasn't absolute and was just the
relative path in `node_modules`.

---------

Co-authored-by: Zack Tanner <[email protected]>
  • Loading branch information
ijjk and ztanner authored May 21, 2024
1 parent 93303b4 commit 1ad97e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/lib/create-next-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,18 @@ async function createNextInstall({
const swcDirectory = fs
.readdirSync(path.join(origRepoDir, 'node_modules/@next'))
.find((directory) => directory.startsWith('swc-'))
process.env.NEXT_TEST_NATIVE_DIR = swcDirectory
process.env.NEXT_TEST_NATIVE_DIR = path.join(
origRepoDir,
'node_modules/@next',
swcDirectory
)
}

// log for clarity of which version we're using
require('console').log({
swcDirectory: process.env.NEXT_TEST_NATIVE_DIR,
})

pkgPaths = await rootSpan
.traceChild('linkPackages')
.traceAsyncFn((span) =>
Expand Down

0 comments on commit 1ad97e4

Please sign in to comment.