diff options
author | Gar <gar+gh@danger.computer> | 2022-03-30 17:46:50 +0300 |
---|---|---|
committer | Gar <wraithgar@github.com> | 2022-04-04 21:35:15 +0300 |
commit | 31a02187a1e0231395ca833f161d6b97ec13f781 (patch) | |
tree | 1619ce31c7dc2723fd42dcd4f5b49db33b13aff6 /test | |
parent | e3da5df4152fbe547f7871547165328e1bf06262 (diff) |
chore: remove unneeded otplease mocks
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/auth/sso.js | 11 | ||||
-rw-r--r-- | test/lib/commands/deprecate.js | 1 | ||||
-rw-r--r-- | test/lib/commands/hook.js | 1 | ||||
-rw-r--r-- | test/lib/commands/org.js | 1 | ||||
-rw-r--r-- | test/lib/commands/owner.js | 3 | ||||
-rw-r--r-- | test/lib/commands/profile.js | 4 | ||||
-rw-r--r-- | test/lib/commands/team.js | 1 | ||||
-rw-r--r-- | test/lib/commands/token.js | 3 |
8 files changed, 0 insertions, 25 deletions
diff --git a/test/lib/auth/sso.js b/test/lib/auth/sso.js index 473c8cc24..eab51f06c 100644 --- a/test/lib/auth/sso.js +++ b/test/lib/auth/sso.js @@ -29,16 +29,6 @@ const sso = t.mock('../../../lib/auth/sso.js', { ) } }, - '../../../lib/utils/otplease.js': (opts, fn) => { - if (opts) { - return fn({ ...opts, otp: '1234' }) - } else { - throw Object.assign( - new Error('failed retrieving otp'), - { code: 'ERROR' } - ) - } - }, }) const npm = { @@ -75,7 +65,6 @@ t.test('simple login', async (t) => { opts, { creds: {}, - otp: '1234', registry: 'https://registry.npmjs.org/', scope: '', ssoType: 'oauth', diff --git a/test/lib/commands/deprecate.js b/test/lib/commands/deprecate.js index 180629a74..37a407c3b 100644 --- a/test/lib/commands/deprecate.js +++ b/test/lib/commands/deprecate.js @@ -19,7 +19,6 @@ npmFetch.json = async (uri, opts) => { const Deprecate = t.mock('../../../lib/commands/deprecate.js', { '../../../lib/utils/get-identity.js': async () => getIdentityImpl(), - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmaccess: { lsPackages: async () => ({ foo: 'write', bar: 'write', baz: 'write', buzz: 'read' }), }, diff --git a/test/lib/commands/hook.js b/test/lib/commands/hook.js index 60a59a3fe..95bac83d7 100644 --- a/test/lib/commands/hook.js +++ b/test/lib/commands/hook.js @@ -63,7 +63,6 @@ const libnpmhook = { } const Hook = t.mock('../../../lib/commands/hook.js', { - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmhook, }) const hook = new Hook(npm) diff --git a/test/lib/commands/org.js b/test/lib/commands/org.js index 3ae951dd5..cd25fc23a 100644 --- a/test/lib/commands/org.js +++ b/test/lib/commands/org.js @@ -43,7 +43,6 @@ const libnpmorg = { } const Org = t.mock('../../../lib/commands/org.js', { - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmorg, }) const org = new Org(npm) diff --git a/test/lib/commands/owner.js b/test/lib/commands/owner.js index 83f4d880f..eadfa2bf0 100644 --- a/test/lib/commands/owner.js +++ b/test/lib/commands/owner.js @@ -21,7 +21,6 @@ const mocks = { 'proc-log': log, 'npm-registry-fetch': npmFetch, pacote, - '../../../lib/utils/otplease.js': async (opts, fn) => fn({ otp: '123456', opts }), '../../../lib/utils/read-package-name.js': async (prefix) => { readPackageNamePrefix = prefix return readPackageNameResponse @@ -193,7 +192,6 @@ t.test('owner add <user> <pkg>', async t => { _rev: '1-foobaaa1', maintainers: npmcliMaintainers, }, - otp: '123456', spec: { name: '@npmcli/map-workspaces', }, @@ -507,7 +505,6 @@ t.test('owner rm <user> <pkg>', async t => { body: { _rev: '1-foobaaa1', }, - otp: '123456', spec: { name: '@npmcli/map-workspaces', }, diff --git a/test/lib/commands/profile.js b/test/lib/commands/profile.js index 82ac49542..da32d4300 100644 --- a/test/lib/commands/profile.js +++ b/test/lib/commands/profile.js @@ -41,10 +41,6 @@ const mocks = { .join('\n') } }, - '../../../lib/utils/pulse-till-done.js': { - withPromise: async a => a, - }, - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), '../../../lib/utils/read-user-info.js': { async password () {}, async otp () {}, diff --git a/test/lib/commands/team.js b/test/lib/commands/team.js index 592dbc3a0..792418788 100644 --- a/test/lib/commands/team.js +++ b/test/lib/commands/team.js @@ -22,7 +22,6 @@ const npm = mockNpm({ const mocks = { libnpmteam, 'cli-columns': a => a.join(' '), - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), } t.afterEach(() => { diff --git a/test/lib/commands/token.js b/test/lib/commands/token.js index 65a094a0b..c32c0b74a 100644 --- a/test/lib/commands/token.js +++ b/test/lib/commands/token.js @@ -10,9 +10,6 @@ const npm = { } const mockToken = (otherMocks) => t.mock('../../../lib/commands/token.js', { - '../../../lib/utils/otplease.js': (opts, fn) => { - return Promise.resolve().then(() => fn(opts)) - }, '../../../lib/utils/read-user-info.js': mocks.readUserInfo, 'npm-profile': mocks.profile, ...otherMocks, |