Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-03-24 19:07:44 +0300
committerGitHub <noreply@github.com>2022-03-24 19:07:44 +0300
commit81afa5a8838c71a3a5037e2c8b4ae196e19fe0d7 (patch)
treed8d65a60bde6f6b913babe6f19f9b79099857b78 /tap-snapshots
parent98bfd9a8cc23930e6becd15fffabadd1c269b0a2 (diff)
fix(unpublish): properly apply publishConfig (#4601)
The tests for unpublish were mocked so heavily they weren't actually asserting anything. In rewriting them several bugs were found. - `write=true` was not being consistenly used when fetching packument data, it is now. - The decision on when to load the local package.json file was not working at all, that has been fixed. If the cwd contains a package.json whose name matches the package you are uninstalling, the local package.json will be read and its publishConfig applied to your request. - dead code inside the `npm unpublish` path was removed. There is no need to check if you are unpublishing the last version here, you're already unpublishing the entire project. - publishConfig is now being applied through the config flatten method, not a raw object assignment.
Diffstat (limited to 'tap-snapshots')
-rw-r--r--tap-snapshots/test/lib/commands/unpublish.js.test.cjs14
1 files changed, 0 insertions, 14 deletions
diff --git a/tap-snapshots/test/lib/commands/unpublish.js.test.cjs b/tap-snapshots/test/lib/commands/unpublish.js.test.cjs
deleted file mode 100644
index d84f26f29..000000000
--- a/tap-snapshots/test/lib/commands/unpublish.js.test.cjs
+++ /dev/null
@@ -1,14 +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/unpublish.js TAP workspaces all workspaces --force > should output all workspaces 1`] = `
-- workspace-a- workspace-b- workspace-n
-`
-
-exports[`test/lib/commands/unpublish.js TAP workspaces one workspace --force > should output one workspaces 1`] = `
-- workspace-a
-`