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

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/fixtures/mock-npm.js')
-rw-r--r--deps/npm/test/fixtures/mock-npm.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/deps/npm/test/fixtures/mock-npm.js b/deps/npm/test/fixtures/mock-npm.js
index 01f482bde29..aa8d44020ee 100644
--- a/deps/npm/test/fixtures/mock-npm.js
+++ b/deps/npm/test/fixtures/mock-npm.js
@@ -2,6 +2,8 @@
// npm.config You still need a separate flatOptions but this is the first step
// to eventually just using npm itself
+const realConfig = require('../../lib/utils/config')
+
const mockLog = {
clearProgress: () => {},
disableProgress: () => {},
@@ -25,10 +27,10 @@ const mockNpm = (base = {}) => {
config: {
// for now just set `find` to what config.find should return
// this works cause `find` is not an existing config entry
- find: (k) => config[k],
- get: (k) => config[k],
+ find: (k) => ({...realConfig.defaults, ...config})[k],
+ get: (k) => ({...realConfig.defaults, ...config})[k],
set: (k, v) => config[k] = v,
- list: [config]
+ list: [{ ...realConfig.defaults, ...config}]
},
}
}