This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not try to re-resolve failed nodes forever
- Loading branch information
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1364,11 +1364,12 @@ t.test('pathologically nested dependency cycle', t => | |
t.resolveMatchSnapshot(printIdeal( | ||
resolve(fixtures, 'pathological-dep-nesting-cycle')))) | ||
|
||
t.test('resolve files from cwd in global mode, Arb path in local mode', t => { | ||
t.test('resolve file deps from cwd', t => { | ||
const cwd = process.cwd() | ||
t.teardown(() => process.chdir(cwd)) | ||
const path = t.testdir({ | ||
global: {} | ||
global: {}, | ||
local: {}, | ||
}) | ||
const fixturedir = resolve(fixtures, 'root-bundler') | ||
process.chdir(fixturedir) | ||
|
@@ -1378,6 +1379,7 @@ t.test('resolve files from cwd in global mode, Arb path in local mode', t => { | |
...OPT, | ||
}) | ||
return arb.buildIdealTree({ | ||
path: `${path}/local`, | ||
add: ['child-1.2.3.tgz'], | ||
global: true, | ||
}).then(tree => { | ||
|
@@ -1386,7 +1388,7 @@ t.test('resolve files from cwd in global mode, Arb path in local mode', t => { | |
}) | ||
}) | ||
|
||
t.only('resolve links in global mode', t => { | ||
t.test('resolve links in global mode', t => { | ||
const path = t.testdir({ | ||
global: {}, | ||
lib: { | ||
|
@@ -1598,3 +1600,39 @@ t.test('push conflicted peer deps deeper in to the tree to solve', async t => { | |
const path = resolve(fixtures, 'testing-peer-dep-conflict-chain/override-dep') | ||
t.matchSnapshot(await printIdeal(path)) | ||
}) | ||
|
||
t.test('do not continually re-resolve deps that failed to load', async t => { | ||
const path = t.testdir({ | ||
node_modules: { | ||
'@isaacs': { | ||
'this-does-not-exist-actually': { | ||
'package.json': JSON.stringify({ | ||
name: '@isaacs/this-does-not-exist-actually', | ||
version: '1.0.0', | ||
}), | ||
}, | ||
'depends-on-load-failer': { | ||
'package.json': JSON.stringify({ | ||
name: '@isaacs/depends-on-load-failer', | ||
version: '1.0.0', | ||
dependencies: { | ||
'@isaacs/this-does-not-exist-actually': '1.x', | ||
}, | ||
}), | ||
}, | ||
}, | ||
}, | ||
'package.json': JSON.stringify({ | ||
name: 'my-project', | ||
version: '1.2.3', | ||
dependencies: { | ||
'@isaacs/depends-on-load-failer': '1.x', | ||
'@isaacs/this-does-not-exist-actually': '1.x', | ||
}, | ||
}), | ||
}) | ||
const arb = new Arborist({...OPT, path }) | ||
t.rejects(() => arb.buildIdealTree({ add: [ | ||
'@isaacs/[email protected]', | ||
]}), { code: 'E404' }) | ||
}) |