From 9e4f02c845c7d22d2994b5ee668f6aaf88a9e4be Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 2 May 2024 09:29:09 -0700 Subject: [PATCH] fixup! fix: run input.start around help and openining urls --- mock-registry/lib/index.js | 4 +--- test/lib/commands/adduser.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mock-registry/lib/index.js b/mock-registry/lib/index.js index 558cb25e2674e..03787ea7cd4e6 100644 --- a/mock-registry/lib/index.js +++ b/mock-registry/lib/index.js @@ -231,7 +231,6 @@ class MockRegistry { this.nock = this.nock .post(this.fullPath('/-/v1/login'), body => { this.#tap.ok(body.create) // Sole difference from weblogin - this.#tap.ok(body.hostname) return true }) .reply(200, { doneUrl, loginUrl }) @@ -243,8 +242,7 @@ class MockRegistry { const doneUrl = new URL('/npm-cli-test/done', this.origin).href const loginUrl = new URL('/npm-cli-test/login', this.origin).href this.nock = this.nock - .post(this.fullPath('/-/v1/login'), body => { - this.#tap.ok(body.hostname) + .post(this.fullPath('/-/v1/login'), () => { return true }) .reply(200, { doneUrl, loginUrl }) diff --git a/test/lib/commands/adduser.js b/test/lib/commands/adduser.js index 410e8c4987ca6..3063cdbeeab5e 100644 --- a/test/lib/commands/adduser.js +++ b/test/lib/commands/adduser.js @@ -9,9 +9,8 @@ const MockRegistry = require('@npmcli/mock-registry') const stream = require('stream') const mockAddUser = async (t, { stdin: stdinLines, registry: registryUrl, ...options } = {}) => { - let stdin if (stdinLines) { - stdin = new stream.PassThrough() + const stdin = new stream.PassThrough() for (const l of stdinLines) { stdin.write(l + '\n') } @@ -30,7 +29,6 @@ const mockAddUser = async (t, { stdin: stdinLines, registry: registryUrl, ...opt }) return { registry, - stdin, rc: () => ini.parse(fs.readFileSync(path.join(mock.home, '.npmrc'), 'utf8')), ...mock, }