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
path: root/test
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2021-05-06 21:04:01 +0300
committerGar <gar+gh@danger.computer>2021-05-06 22:46:31 +0300
commit7773b401554fb0365001e8aaa93524d60cc021a6 (patch)
treeac39b4f8ebe393afa8197d03a23c22804e9a800e /test
parentd84b1bd23244c80a49cc9d3edef56b5a102f7c36 (diff)
fix(tests): reflect new libnpmexec logic
PR-URL: https://github.com/npm/cli/pull/3198 Credit: @wraithgar Close: #3198 Reviewed-by: @nlf, @darcyclarke
Diffstat (limited to 'test')
-rw-r--r--test/lib/exec.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/lib/exec.js b/test/lib/exec.js
index 5ecc73274..3d2da32a7 100644
--- a/test/lib/exec.js
+++ b/test/lib/exec.js
@@ -121,11 +121,15 @@ t.afterEach(() => {
t.test('npx foo, bin already exists locally', t => {
const path = t.testdir({
- foo: 'just some file',
+ node_modules: {
+ '.bin': {
+ foo: 'just some file',
+ },
+ },
})
PROGRESS_IGNORED = true
- npm.localBin = path
+ npm.localBin = resolve(path, 'node_modules', '.bin')
exec.exec(['foo', 'one arg', 'two arg'], er => {
t.error(er, 'npm exec')
@@ -137,7 +141,7 @@ t.test('npx foo, bin already exists locally', t => {
stdioString: true,
event: 'npx',
env: {
- PATH: [path, ...PATH].join(delimiter),
+ PATH: [npm.localBin, ...PATH].join(delimiter),
},
stdio: 'inherit',
}])
@@ -147,11 +151,15 @@ t.test('npx foo, bin already exists locally', t => {
t.test('npx foo, bin already exists globally', t => {
const path = t.testdir({
- foo: 'just some file',
+ node_modules: {
+ '.bin': {
+ foo: 'just some file',
+ },
+ },
})
PROGRESS_IGNORED = true
- npm.globalBin = path
+ npm.globalBin = resolve(path, 'node_modules', '.bin')
exec.exec(['foo', 'one arg', 'two arg'], er => {
t.error(er, 'npm exec')
@@ -163,7 +171,7 @@ t.test('npx foo, bin already exists globally', t => {
stdioString: true,
event: 'npx',
env: {
- PATH: [path, ...PATH].join(delimiter),
+ PATH: [npm.globalBin, ...PATH].join(delimiter),
},
stdio: 'inherit',
}])