diff options
author | Gar <gar+gh@danger.computer> | 2022-09-08 19:50:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-08 19:50:33 +0300 |
commit | 2e9280072f9852466fa0944d3a0fdb0c8af156a9 (patch) | |
tree | 7c3144280321988ce120a738a7d37c4643fc2668 /test | |
parent | 412cbabc64f8a94a8bd85c562b12c908295264db (diff) |
feat: remove `npm bin` (#5459)
BREAKING CHANGE: this removes the `npm bin` command
The output of this command is misleading and incomplete. The `.bin`
resolution of npm is much more nuanced than this command implies, and
the output of `npm bin` is not something end users should be dealing
with. `npm` itself is responsible for running the `bin` entries of
modules, with the exception of global bins, which end up in the same
folder as `node` itself, presumably already in a user's path since they
can run node.
Closes https://github.com/npm/statusboard/issues/537
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/commands/bin.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/test/lib/commands/bin.js b/test/lib/commands/bin.js deleted file mode 100644 index 46170e765..000000000 --- a/test/lib/commands/bin.js +++ /dev/null @@ -1,32 +0,0 @@ -const t = require('tap') -const { load: loadMockNpm } = require('../../fixtures/mock-npm') -const mockGlobals = require('../../fixtures/mock-globals') - -t.test('bin not global', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.localBin) - t.match(logs.error, []) -}) - -t.test('bin global in env.path', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t, { - config: { global: true }, - }) - - mockGlobals(t, { - 'process.env': { path: npm.globalBin }, - }) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.globalBin) - t.match(logs.error, []) -}) - -t.test('bin not in path', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t, { - config: { global: true }, - }) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.globalBin) - t.match(logs.error, [['bin', '(not in PATH env variable)']]) -}) |