Lines Matching defs:profile

6     'npm-profile': npmProfile || {
27 command: 'profile',
60 const { profile } = await mockProfile(t)
61 await t.rejects(profile.exec([]), await profile.usage)
64 t.test('profile get no args', async t => {
72 const { profile, result } = await mockProfile(t, { npmProfile: defaultNpmProfile })
73 await profile.exec(['get'])
79 const { profile, result } = await mockProfile(t, {
84 await profile.exec(['get'])
86 t.same(JSON.parse(result()), userProfile, 'should output json profile result')
90 const { profile, result } = await mockProfile(t, {
95 await profile.exec(['get'])
96 t.matchSnapshot(result(), 'should output all profile info as parseable result')
100 const { profile, result } = await mockProfile(t, {
105 await profile.exec(['get'])
106 t.matchSnapshot(result(), 'should output all profile info with color result')
118 const { profile, result } = await mockProfile(t, { npmProfile })
120 await profile.exec(['get'])
121 t.matchSnapshot(result(), 'should output expected profile values')
134 const { profile, result } = await mockProfile(t, { npmProfile })
136 await profile.exec(['get'])
141 t.test('profile has cidr_whitelist item', async t => {
151 const { profile, result } = await mockProfile(t, { npmProfile })
153 await profile.exec(['get'])
159 t.test('profile get <key>', async t => {
167 const { profile, result } = await mockProfile(t, { npmProfile })
169 await profile.exec(['get', 'name'])
175 const { profile, result } = await mockProfile(t, {
180 await profile.exec(['get', 'name'])
185 'should output json profile result ignoring args filter'
190 const { profile, result } = await mockProfile(t, {
195 await profile.exec(['get', 'name'])
201 t.test('profile get multiple args', async t => {
209 const { profile, result } = await mockProfile(t, {
212 await profile.exec(['get', 'name', 'email', 'github'])
219 const { profile, result } = await mockProfile(t, {
224 await profile.exec(['get', 'name', 'email', 'github'])
226 t.same(JSON.parse(result()), userProfile, 'should output json profile result and ignore args')
231 const { profile, result } = await mockProfile(t, {
236 await profile.exec(['get', 'name', 'email', 'github'])
238 t.matchSnapshot(result(), 'should output parseable profile value results')
242 const { profile, result } = await mockProfile(t, {
246 await profile.exec(['get', 'name,email,github'])
252 t.test('profile set <key> <value>', async t => {
254 const { profile } = await mockProfile(t)
257 profile.exec(['set']),
258 /npm profile set <prop> <value>/,
264 const { profile } = await mockProfile(t)
266 profile.exec(['set', 'email']),
267 /npm profile set <prop> <value>/,
273 const { profile } = await mockProfile(t)
275 profile.exec(['set', 'password', '1234']),
282 const { profile } = await mockProfile(t)
284 profile.exec(['set', 'name', 'foo']),
313 const { profile, result } = await mockProfile(t, {
317 await profile.exec(['set', 'fullname', 'Lorem Ipsum'])
326 const { profile, result } = await mockProfile(t, {
331 await profile.exec(['set', 'fullname', 'Lorem Ipsum'])
346 const { profile, result } = await mockProfile(t, {
351 await profile.exec(['set', 'fullname', 'Lorem Ipsum'])
379 const { profile, result } = await mockProfile(t, {
383 await profile.exec(['set', 'email', 'foo@npmjs.com'])
427 const { profile, result } = await mockProfile(t, {
432 await profile.exec(['set', 'password'])
468 const { profile, result, logs } = await mockProfile(t, {
473 await profile.exec(['set', 'password'])
487 const { profile } = await mockProfile(t)
489 profile.exec(['enable-2fa', 'foo', 'bar']),
490 /npm profile enable-2fa \[auth-and-writes|auth-only\]/,
496 const { profile } = await mockProfile(t)
498 profile.exec(['enable-2fa', 'foo']),
506 const { profile } = await mockProfile(t, { config })
509 profile.exec(['enable-2fa', 'auth-only']),
518 const { profile } = await mockProfile(t, { config })
521 profile.exec(['enable-2fa', 'auth-only']),
538 const { npm, profile } = await mockProfile(t, {
550 profile.exec(['enable-2fa', 'auth-only']),
565 const { npm, profile } = await mockProfile(t, {
576 profile.exec(['enable-2fa', 'auth-only']),
585 const { npm, profile } = await mockProfile(t)
591 profile.exec(['enable-2fa', 'auth-only']),
639 const { npm, profile, result } = await mockProfile(t, {
658 await profile.exec(['enable-2fa', 'auth-only'])
682 // when profile response shows that 2fa is pending the
683 // first time calling npm-profile.set should reset 2fa
740 const { npm, profile, result } = await mockProfile(t, {
752 await profile.exec(['enable-2fa', 'auth-only'])
784 const { npm, profile } = await mockProfile(t, {
795 profile.exec(['enable-2fa', 'auth-only']),
823 const { npm, profile, result } = await mockProfile(t, {
833 await profile.exec(['enable-2fa', 'auth-and-writes'])
842 t.test('missing tfa from user profile', async t => {
867 const { npm, profile, result } = await mockProfile(t, {
876 await profile.exec(['enable-2fa', 'auth-only'])
910 const { npm, profile, result } = await mockProfile(t, {
919 await profile.exec(['enable-2fa'])
939 const { profile, result } = await mockProfile(t, {
943 await profile.exec(['disable-2fa'])
962 'should send the new info for setting in profile'
985 const { profile, result } = await mockProfile(t, {
990 await profile.exec(['disable-2fa'])
999 const { profile, result } = await mockProfile(t, {
1005 await profile.exec(['disable-2fa'])
1015 const { profile, result } = await mockProfile(t, {
1021 await profile.exec(['disable-2fa'])
1043 'should send the new info for setting in profile'
1057 const { profile, result } = await mockProfile(t, {
1063 await profile.exec(['disable-2fa'])
1070 const { profile } = await mockProfile(t)
1073 profile.exec(['asfd']),
1074 /Unknown profile command: asfd/,
1081 const { profile } = await mockProfile(t)
1082 t.resolveMatch(profile.completion({ conf: { argv: { remain: argv } } }), expect, title)
1085 t.test('npm profile autocomplete', async t => {
1087 argv: ['npm', 'profile'],
1093 t.test('npm profile enable autocomplete', async t => {
1095 argv: ['npm', 'profile', 'enable-2fa'],
1101 t.test('npm profile <subcmd> no autocomplete', async t => {
1105 argv: ['npm', 'profile', subcmd],
1112 t.test('npm profile unknown subcommand autocomplete', async t => {
1113 const { profile } = await mockProfile(t)
1115 profile.completion({ conf: { argv: { remain: ['npm', 'profile', 'asdf'] } } }),