Skip to content

Commit

Permalink
fix: don't crash if total memory is not supported (#3879)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 3, 2023
1 parent 0c53e09 commit 7d1f86b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vitest/src/node/config.ts
Expand Up @@ -213,9 +213,11 @@ export function resolveConfig(
snapshotEnvironment: null as any,
}

const memory = totalmem()

resolved.experimentalVmWorkerMemoryLimit = stringToBytes(
getWorkerMemoryLimit(resolved),
resolved.watch ? totalmem() / 2 : totalmem(),
typeof memory === 'number' && resolved.watch ? memory / 2 : memory,
)

if (options.resolveSnapshotPath)
Expand Down

0 comments on commit 7d1f86b

Please sign in to comment.