mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
ce738b9f8c
This is aiming to fix sporadic failures from jest transforms which is most likely caused by the change to output to custom jest-cache folder and wipe that between runs. Instead this disables the cache via `--no-cache` flag and also fixes WASM bindings issue that started due to cache not being available. x-ref: https://github.com/vercel/next.js/actions/runs/22109996356/job/63903450669?pr=90096#step:35:493 x-ref: https://github.com/vercel/next.js/actions/runs/22109996356/job/63903820197?pr=90096#step:35:18167
18 lines
443 B
TypeScript
18 lines
443 B
TypeScript
let loggedTurbopack = false
|
|
|
|
export function shouldUseTurbopack(): boolean {
|
|
if (!!process.env.NEXT_TEST_WASM || !!process.env.NEXT_TEST_WASM_AFTER_JEST) {
|
|
return false
|
|
}
|
|
|
|
const enabled = !!process.env.IS_TURBOPACK_TEST
|
|
if (enabled && !loggedTurbopack) {
|
|
require('console').log(
|
|
`Running tests with turbopack because environment variable IS_TURBOPACK_TEST is set`
|
|
)
|
|
loggedTurbopack = true
|
|
}
|
|
|
|
return enabled
|
|
}
|