Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-01-06 03:28:18 +0300
committerisaacs <i@izs.me>2021-01-07 23:13:38 +0300
commitd01746a5a6dde115ee6a600cdf54c9b35afcab3f (patch)
tree145de979bb658db3fab436fcbd13f55d374d6972 /test/lib/utils
parent7a49fd4afc8cd24db40aee008031ea648583d0bc (diff)
Remove process.umask() call from config defaultisaacs/remove-process-umask
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103 PR-URL: https://github.com/npm/cli/pull/2444 Credit: @isaacs Close: #2444 Reviewed-by: @nlf
Diffstat (limited to 'test/lib/utils')
-rw-r--r--test/lib/utils/config.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/test/lib/utils/config.js b/test/lib/utils/config.js
index 38fbe6753..4d4b1a1d1 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', {