Lines Matching defs:npm
2 const mockNpm = require('../../fixtures/mock-npm')
6 'npm-profile': npmProfile || {
56 github: 'https://github.com/npm',
258 /npm profile set <prop> <value>/,
267 /npm profile set <prop> <value>/,
490 /npm profile enable-2fa \[auth-and-writes|auth-only\]/,
538 const { npm, profile } = await mockProfile(t, {
544 npm.config.getCredentialsByURI = reg => {
545 t.equal(reg, npm.flatOptions.registry, 'should use expected registry')
565 const { npm, profile } = await mockProfile(t, {
571 npm.config.getCredentialsByURI = () => {
585 const { npm, profile } = await mockProfile(t)
588 npm.config.getCredentialsByURI = () => ({})
639 const { npm, profile, result } = await mockProfile(t, {
646 npm.config.getCredentialsByURI = reg => {
647 t.equal(reg, npm.flatOptions.registry, 'should use expected registry')
650 npm.config.setCredentialsByURI = (registry, { token }) => {
651 t.equal(registry, npm.flatOptions.registry, 'should set expected registry')
654 npm.config.save = type => {
683 // first time calling npm-profile.set should reset 2fa
740 const { npm, profile, result } = await mockProfile(t, {
748 npm.config.getCredentialsByURI = () => {
784 const { npm, profile } = await mockProfile(t, {
790 npm.config.getCredentialsByURI = () => {
823 const { npm, profile, result } = await mockProfile(t, {
829 npm.config.getCredentialsByURI = reg => {
867 const { npm, profile, result } = await mockProfile(t, {
872 npm.config.getCredentialsByURI = reg => {
910 const { npm, profile, result } = await mockProfile(t, {
915 npm.config.getCredentialsByURI = reg => {
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 => {
1115 profile.completion({ conf: { argv: { remain: ['npm', 'profile', 'asdf'] } } }),