From 8da28b403f32d2e99c842893bdc40429b8ffa9a7 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 30 Mar 2022 07:09:57 -0700 Subject: fix: remove lib/utils/read-package-name.js This code wasn't doing anything special, just dereferencing `name` from a packument. There is no need for this to exist. Most of the tests were able to handle having this go away, except for `npm owner` which had to have its tests rewritten to be real, which of course surfaced bugs along the way of behavior that was incorrectly being tested. `npm owner` needs some love to clean up its UX, it throws or returns inconsistently. I did fix it so that if there is no package.json in cwd it errored as expected instead of throwing `ENOENT` which is what it did before. --- tap-snapshots/test/lib/commands/owner.js.test.cjs | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 tap-snapshots/test/lib/commands/owner.js.test.cjs (limited to 'tap-snapshots/test/lib') diff --git a/tap-snapshots/test/lib/commands/owner.js.test.cjs b/tap-snapshots/test/lib/commands/owner.js.test.cjs deleted file mode 100644 index f3d7335e4..000000000 --- a/tap-snapshots/test/lib/commands/owner.js.test.cjs +++ /dev/null @@ -1,20 +0,0 @@ -/* IMPORTANT - * This snapshot file is auto-generated, but designed for humans. - * It should be checked into source control and tracked carefully. - * Re-generate by setting TAP_SNAPSHOT=1 and running tests. - * Make sure to inspect the output below. Do not ignore changes! - */ -'use strict' -exports[`test/lib/commands/owner.js TAP owner ls > should output owners of 1`] = ` -nlf -ruyadorno -darcyclarke -isaacs -` - -exports[`test/lib/commands/owner.js TAP owner ls no args > should output owners of cwd package 1`] = ` -nlf -ruyadorno -darcyclarke -isaacs -` -- cgit v1.2.3