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:
authornlf <quitlahok@gmail.com>2022-03-24 23:52:50 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-03-28 23:19:59 +0300
commit18b8b94357d8f57301fbaa0f1e5dc2cf1128bf3e (patch)
treeac48ea68fcd9b5611e1a6e475bc431bb5ac39b63 /workspaces/arborist/test
parent6f9cb490e7299976c43c6a118036c130671fe188 (diff)
fix(arborist): make sure resolveParent exists before checking props
Diffstat (limited to 'workspaces/arborist/test')
-rw-r--r--workspaces/arborist/test/arborist/reify.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/workspaces/arborist/test/arborist/reify.js b/workspaces/arborist/test/arborist/reify.js
index 7c22f7c69..9124b4630 100644
--- a/workspaces/arborist/test/arborist/reify.js
+++ b/workspaces/arborist/test/arborist/reify.js
@@ -2622,5 +2622,33 @@ t.test('save package.json on update', t => {
'should save no top level dep update to root package.json'
)
})
+
+ t.test('should not throw when trying to update a link dep', async t => {
+ const path = t.testdir({
+ one: {
+ 'package.json': JSON.stringify({
+ name: 'one',
+ version: '1.0.0',
+ dependencies: {
+ two: 'file:../two',
+ },
+ }),
+ },
+ two: {
+ 'package.json': JSON.stringify({
+ name: 'two',
+ version: '1.0.0',
+ }),
+ },
+ })
+
+ await t.resolves(reify(resolve(path, 'one'), { update: true, save: true, workspaces: [] }))
+
+ t.equal(
+ require(resolve(path, 'one', 'package.json')).dependencies.two,
+ 'file:../two',
+ 'should have made no changes'
+ )
+ })
t.end()
})