diff --git a/test/common/index.js b/test/common/index.js index c04cac27bf2eca..c84933fd6eb3b3 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -34,6 +34,14 @@ const { hasIntl } = process.binding('config'); +// Some tests assume a umask of 0o022 so set that up front. Tests that need a +// different umask will set it themselves. +// +// process.umask() is not available in workers so we need to check for its +// existence. +if (process.umask) + process.umask(0o022); + const noop = () => {}; const hasCrypto = Boolean(process.versions.openssl);