diff --git a/lib/utils/config.js b/lib/utils/config.js index 2b6b96e5c8190..426f0a5291406 100644 --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -170,7 +170,7 @@ const defaults = { 'tag-version-prefix': 'v', timing: false, tmp: tmpdir(), - umask: process.umask ? process.umask() : 0o22, + umask: 0, unicode, 'update-notifier': true, usage: false, diff --git a/tap-snapshots/test-lib-utils-config.js-TAP.test.js b/tap-snapshots/test-lib-utils-config.js-TAP.test.js index d14c9e9503513..b9ebc4a65a014 100644 --- a/tap-snapshots/test-lib-utils-config.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-config.js-TAP.test.js @@ -131,7 +131,7 @@ Object { "tag-version-prefix": "v", "timing": false, "tmp": "/tmp", - "umask": 18, + "umask": 0, "unicode": true, "update-notifier": true, "usage": false, @@ -658,7 +658,7 @@ Object { "tag-version-prefix": "v", "timing": false, "tmp": "/tmp", - "umask": 22, + "umask": 0, "unicode": true, "update-notifier": true, "usage": false, @@ -1185,7 +1185,7 @@ Object { "tag-version-prefix": "v", "timing": false, "tmp": "/tmp", - "umask": 22, + "umask": 0, "unicode": true, "update-notifier": true, "usage": false, diff --git a/test/lib/utils/config.js b/test/lib/utils/config.js index 38fbe6753e75b..4d4b1a1d1a70d 100644 --- a/test/lib/utils/config.js +++ b/test/lib/utils/config.js @@ -1,11 +1,5 @@ const t = require('tap') const requireInject = require('require-inject') -Object.defineProperty(process, 'umask', { - value: () => 0o26, - writable: true, - configurable: true, - enumerable: true, -}) // have to fake the node version, or else it'll only pass on this one Object.defineProperty(process, 'version', { @@ -93,32 +87,6 @@ t.test('no working network interfaces, on windows', t => { t.end() }) -t.test('no process.umask() method', t => { - Object.defineProperty(process, 'umask', { - value: null, - writable: true, - configurable: true, - enumerable: true, - }) - t.teardown(() => { - Object.defineProperty(process, 'umask', { - value: () => 0o26, - writable: true, - configurable: true, - enumerable: true, - }) - }) - const config = requireInject('../../../lib/utils/config.js', { - os: { tmpdir, networkInterfaces: networkInterfacesThrow }, - '@npmcli/ci-detect': () => false, - '../../../lib/utils/is-windows.js': true, - '../../../package.json': pkg, - }) - t.equal(config.defaults.umask, 0o22) - t.matchSnapshot(config) - t.end() -}) - t.test('no comspec on windows', t => { delete process.env.ComSpec const config = requireInject('../../../lib/utils/config.js', {