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:
Diffstat (limited to 'test/lib/adduser.js')
-rw-r--r--test/lib/adduser.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/lib/adduser.js b/test/lib/adduser.js
index 4e6a56fc1..36f59e085 100644
--- a/test/lib/adduser.js
+++ b/test/lib/adduser.js
@@ -9,21 +9,27 @@ const _flatOptions = {
authType: 'legacy',
registry: 'https://registry.npmjs.org/',
scope: '',
+ fromFlatOptions: true,
}
let failSave = false
let deletedConfig = {}
let registryOutput = ''
let setConfig = {}
-const authDummy = () => Promise.resolve({
- message: 'success',
- newCreds: {
- username: 'u',
- password: 'p',
- email: 'u@npmjs.org',
- alwaysAuth: false,
- },
-})
+const authDummy = (options) => {
+ if (!options.fromFlatOptions)
+ throw new Error('did not pass full flatOptions to auth function')
+
+ return Promise.resolve({
+ message: 'success',
+ newCreds: {
+ username: 'u',
+ password: 'p',
+ email: 'u@npmjs.org',
+ alwaysAuth: false,
+ },
+ })
+}
const deleteMock = (key, where) => {
deletedConfig = {