Skip to content

Commit 31a0218

Browse files
committed
chore: remove unneeded otplease mocks
1 parent e3da5df commit 31a0218

File tree

8 files changed

+0
-25
lines changed

8 files changed

+0
-25
lines changed

test/lib/auth/sso.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ const sso = t.mock('../../../lib/auth/sso.js', {
2929
)
3030
}
3131
},
32-
'../../../lib/utils/otplease.js': (opts, fn) => {
33-
if (opts) {
34-
return fn({ ...opts, otp: '1234' })
35-
} else {
36-
throw Object.assign(
37-
new Error('failed retrieving otp'),
38-
{ code: 'ERROR' }
39-
)
40-
}
41-
},
4232
})
4333

4434
const npm = {
@@ -75,7 +65,6 @@ t.test('simple login', async (t) => {
7565
opts,
7666
{
7767
creds: {},
78-
otp: '1234',
7968
registry: 'https://registry.npmjs.org/',
8069
scope: '',
8170
ssoType: 'oauth',

test/lib/commands/deprecate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ npmFetch.json = async (uri, opts) => {
1919

2020
const Deprecate = t.mock('../../../lib/commands/deprecate.js', {
2121
'../../../lib/utils/get-identity.js': async () => getIdentityImpl(),
22-
'../../../lib/utils/otplease.js': async (opts, fn) => fn(opts),
2322
libnpmaccess: {
2423
lsPackages: async () => ({ foo: 'write', bar: 'write', baz: 'write', buzz: 'read' }),
2524
},

test/lib/commands/hook.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const libnpmhook = {
6363
}
6464

6565
const Hook = t.mock('../../../lib/commands/hook.js', {
66-
'../../../lib/utils/otplease.js': async (opts, fn) => fn(opts),
6766
libnpmhook,
6867
})
6968
const hook = new Hook(npm)

test/lib/commands/org.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const libnpmorg = {
4343
}
4444

4545
const Org = t.mock('../../../lib/commands/org.js', {
46-
'../../../lib/utils/otplease.js': async (opts, fn) => fn(opts),
4746
libnpmorg,
4847
})
4948
const org = new Org(npm)

test/lib/commands/owner.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const mocks = {
2121
'proc-log': log,
2222
'npm-registry-fetch': npmFetch,
2323
pacote,
24-
'../../../lib/utils/otplease.js': async (opts, fn) => fn({ otp: '123456', opts }),
2524
'../../../lib/utils/read-package-name.js': async (prefix) => {
2625
readPackageNamePrefix = prefix
2726
return readPackageNameResponse
@@ -193,7 +192,6 @@ t.test('owner add <user> <pkg>', async t => {
193192
_rev: '1-foobaaa1',
194193
maintainers: npmcliMaintainers,
195194
},
196-
otp: '123456',
197195
spec: {
198196
name: '@npmcli/map-workspaces',
199197
},
@@ -507,7 +505,6 @@ t.test('owner rm <user> <pkg>', async t => {
507505
body: {
508506
_rev: '1-foobaaa1',
509507
},
510-
otp: '123456',
511508
spec: {
512509
name: '@npmcli/map-workspaces',
513510
},

test/lib/commands/profile.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ const mocks = {
4141
.join('\n')
4242
}
4343
},
44-
'../../../lib/utils/pulse-till-done.js': {
45-
withPromise: async a => a,
46-
},
47-
'../../../lib/utils/otplease.js': async (opts, fn) => fn(opts),
4844
'../../../lib/utils/read-user-info.js': {
4945
async password () {},
5046
async otp () {},

test/lib/commands/team.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const npm = mockNpm({
2222
const mocks = {
2323
libnpmteam,
2424
'cli-columns': a => a.join(' '),
25-
'../../../lib/utils/otplease.js': async (opts, fn) => fn(opts),
2625
}
2726

2827
t.afterEach(() => {

test/lib/commands/token.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ const npm = {
1010
}
1111

1212
const mockToken = (otherMocks) => t.mock('../../../lib/commands/token.js', {
13-
'../../../lib/utils/otplease.js': (opts, fn) => {
14-
return Promise.resolve().then(() => fn(opts))
15-
},
1613
'../../../lib/utils/read-user-info.js': mocks.readUserInfo,
1714
'npm-profile': mocks.profile,
1815
...otherMocks,

0 commit comments

Comments
 (0)