Lines Matching refs:async
4 const mockProfile = async (t, { npmProfile, readUserInfo, qrcode, config, ...opts } = {}) => {
7 async get () {},
8 async set () {},
9 async createToken () {},
20 async password () {},
21 async otp () {},
59 t.test('no args', async t => {
64 t.test('profile get no args', async t => {
66 async get () {
71 t.test('default output', async t => {
78 t.test('--json', async t => {
89 t.test('--parseable', async t => {
99 t.test('--color', async t => {
109 t.test('no tfa enabled', async t => {
111 async get () {
124 t.test('unverified email', async t => {
126 async get () {
141 t.test('profile has cidr_whitelist item', async t => {
143 async get () {
159 t.test('profile get <key>', async t => {
161 async get () {
166 t.test('default output', async t => {
174 t.test('--json', async t => {
189 t.test('--parseable', async t => {
201 t.test('profile get multiple args', async t => {
203 async get () {
208 t.test('default output', async t => {
217 t.test('--json', async t => {
229 t.test('--parseable', async t => {
241 t.test('comma separated', async t => {
252 t.test('profile set <key> <value>', async t => {
253 t.test('no key', async t => {
263 t.test('no value', async t => {
272 t.test('set password', async t => {
281 t.test('unwritable key', async t => {
291 async get () {
294 async set (newUser) {
309 t.test('writable key', async t => {
310 t.test('default output', async t => {
321 t.test('--json', async t => {
342 t.test('--parseable', async t => {
357 t.test('write new email', async t => {
361 async get () {
364 async set (newUser) {
387 t.test('change password', async t => {
391 async get () {
394 async set (newUser) {
412 async password (label) {
437 t.test('password confirmation mismatch', async t => {
443 async get () {
446 async set () {
452 async password (label) {
485 t.test('enable-2fa', async t => {
486 t.test('invalid args', async t => {
495 t.test('invalid two factor auth mode', async t => {
504 t.test('no support for --json output', async t => {
516 t.test('no support for --parseable output', async t => {
528 t.test('no bearer tokens returned by registry', async t => {
532 async createToken (pass) {
558 t.test('from basic username/password auth', async t => {
560 async createToken (pass) {
584 t.test('no auth found', async t => {
596 t.test('from basic auth, asks for otp', async t => {
600 async createToken (pass) {
604 async get () {
607 async set (newProfile, conf) {
625 async password () {
629 async otp (label) {
666 t.test('from token and set otp, retries on pending and verifies with qrcode', async t => {
671 async get () {
679 async set (newProfile, conf) {
727 async password () {
730 async otp () {
757 t.test('from token and set otp, retrieves invalid otp', async t => {
759 async get () {
767 async set (newProfile, conf) {
776 async password () {
779 async otp (label) {
801 t.test('from token auth provides --otp config arg', async t => {
803 async get () {
806 async set (newProfile, conf) {
815 async password () {
818 async otp () {
842 t.test('missing tfa from user profile', async t => {
844 async get () {
850 async set (newProfile, conf) {
859 async password () {
862 async otp () {
885 t.test('defaults to auth-and-writes permission if no mode specified', async t => {
887 async get () {
893 async set (newProfile, conf) {
902 async password () {
905 async otp () {
928 t.test('disable-2fa', async t => {
929 t.test('no tfa enabled', async t => {
931 async get () {
948 t.test('requests otp', async t => {
950 async get () {
953 async set (newProfile, conf) {
968 async password () {
972 async otp (label) {
982 t.test('default output', async t => {
994 t.test('--json', async t => {
1010 t.test('--parseable', async t => {
1027 t.test('--otp config already set', async t => {
1031 async get () {
1034 async set (newProfile, conf) {
1049 async password () {
1052 async otp (label) {
1069 t.test('unknown subcommand', async t => {
1079 t.test('completion', async t => {
1080 const testComp = async (t, { argv, expect, title } = {}) => {
1085 t.test('npm profile autocomplete', async t => {
1093 t.test('npm profile enable autocomplete', async t => {
1101 t.test('npm profile <subcmd> no autocomplete', async t => {
1112 t.test('npm profile unknown subcommand autocomplete', async t => {