Debian Codegraph @

workspaces/arborist/tap-snapshots/test/place-dep.js.test.cjs

raw
1 /* IMPORTANT
2 * This snapshot file is auto-generated, but designed for humans.
3 * It should be checked into source control and tracked carefully.
4 * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
5 * Make sure to inspect the output below. Do not ignore changes!
6 */
7 'use strict'
8 exports[`test/place-dep.js TAP placement tests accept an older transitive dependency > changes to tree 1`] = `
9 --- expected
10 +++ actual
11
12 `
13
14 exports[`test/place-dep.js TAP placement tests accept an older transitive dependency > placements 1`] = `
15 Array [
16 Object {
17 "canPlace": null,
18 "canPlaceSelf": null,
19 "checks": Map {},
20 "dep": "[email protected]",
21 "edge": "{ node_modules/foo prod bar@1 }",
22 "placed": null,
23 },
24 ]
25 `
26
27 exports[`test/place-dep.js TAP placement tests accept an older transitive dependency > warnings 1`] = `
28 Array []
29 `
30
31 exports[`test/place-dep.js TAP placement tests basic placement of a production dep > changes to tree 1`] = `
32 --- expected
33 +++ actual
34 @@ -12,8 +12,27 @@
35 "type": "prod",
36 "name": "foo",
37 "spec": "1",
38 - "to": null,
39 - "error": "MISSING",
40 + "to": "node_modules/foo",
41 },
42 },
43 + "children": Map {
44 + "foo" => ArboristNode {
45 + "name": "foo",
46 + "version": "1.0.0",
47 + "location": "node_modules/foo",
48 + "path": "/some/path/node_modules/foo",
49 + "extraneous": true,
50 + "dev": true,
51 + "optional": true,
52 + "peer": true,
53 + "edgesIn": Set {
54 + EdgeIn {
55 + "type": "prod",
56 + "name": "foo",
57 + "spec": "1",
58 + "from": "",
59 + },
60 + },
61 + },
62 + },
63 }
64
65 `
66
67 exports[`test/place-dep.js TAP placement tests basic placement of a production dep > placements 1`] = `
68 Array [
69 Object {
70 "canPlace": Symbol(OK),
71 "canPlaceSelf": Symbol(OK),
72 "checks": Map {
73 "" => Array [
74 Symbol(OK),
75 Symbol(OK),
76 ],
77 },
78 "dep": "[email protected]",
79 "edge": "{ ROOT prod foo@1 }",
80 "placed": "node_modules/foo",
81 },
82 ]
83 `
84
85 exports[`test/place-dep.js TAP placement tests basic placement of a production dep > warnings 1`] = `
86 Array []
87 `
88
89 exports[`test/place-dep.js TAP placement tests basic placement of a production dep with peer deps > changes to tree 1`] = `
90 --- expected
91 +++ actual
92 @@ -12,8 +12,79 @@
93 "type": "prod",
94 "name": "foo",
95 "spec": "1",
96 - "to": null,
97 - "error": "MISSING",
98 + "to": "node_modules/foo",
99 },
100 },
101 + "children": Map {
102 + "bar" => ArboristNode {
103 + "name": "bar",
104 + "version": "1.0.0",
105 + "location": "node_modules/bar",
106 + "path": "/some/path/node_modules/bar",
107 + "extraneous": true,
108 + "dev": true,
109 + "optional": true,
110 + "peer": true,
111 + "edgesOut": Map {
112 + "baz" => EdgeOut {
113 + "type": "peer",
114 + "name": "baz",
115 + "spec": "*",
116 + "to": "node_modules/baz",
117 + },
118 + },
119 + "edgesIn": Set {
120 + EdgeIn {
121 + "type": "peer",
122 + "name": "bar",
123 + "spec": "*",
124 + "from": "node_modules/foo",
125 + },
126 + },
127 + },
128 + "baz" => ArboristNode {
129 + "name": "baz",
130 + "version": "1.0.0",
131 + "location": "node_modules/baz",
132 + "path": "/some/path/node_modules/baz",
133 + "extraneous": true,
134 + "dev": true,
135 + "optional": true,
136 + "peer": true,
137 + "edgesIn": Set {
138 + EdgeIn {
139 + "type": "peer",
140 + "name": "baz",
141 + "spec": "*",
142 + "from": "node_modules/bar",
143 + },
144 + },
145 + },
146 + "foo" => ArboristNode {
147 + "name": "foo",
148 + "version": "1.0.0",
149 + "location": "node_modules/foo",
150 + "path": "/some/path/node_modules/foo",
151 + "extraneous": true,
152 + "dev": true,
153 + "optional": true,
154 + "peer": true,
155 + "edgesOut": Map {
156 + "bar" => EdgeOut {
157 + "type": "peer",
158 + "name": "bar",
159 + "spec": "*",
160 + "to": "node_modules/bar",
161 + },
162 + },
163 + "edgesIn": Set {
164 + EdgeIn {
165 + "type": "prod",
166 + "name": "foo",
167 + "spec": "1",
168 + "from": "",
169 + },
170 + },
171 + },
172 + },
173 }
174
175 `
176
177 exports[`test/place-dep.js TAP placement tests basic placement of a production dep with peer deps > placements 1`] = `
178 Array [
179 Object {
180 "canPlace": Symbol(OK),
181 "canPlaceSelf": Symbol(OK),
182 "checks": Map {
183 "" => Array [
184 Symbol(OK),
185 Symbol(OK),
186 ],
187 },
188 "dep": "[email protected]",
189 "edge": "{ ROOT prod foo@1 }",
190 "placed": "node_modules/foo",
191 },
192 Object {
193 "canPlace": Symbol(OK),
194 "canPlaceSelf": Symbol(OK),
195 "checks": Map {
196 "" => Array [
197 Symbol(OK),
198 Symbol(OK),
199 ],
200 },
201 "dep": "[email protected]",
202 "edge": "{ node_modules/foo peer bar@ }",
203 "parent": "foo",
204 "placed": "node_modules/bar",
205 },
206 Object {
207 "canPlace": Symbol(OK),
208 "canPlaceSelf": Symbol(OK),
209 "checks": Map {
210 "" => Array [
211 Symbol(OK),
212 Symbol(OK),
213 ],
214 },
215 "dep": "[email protected]",
216 "edge": "{ node_modules/bar peer baz@ }",
217 "parent": "bar",
218 "placed": "node_modules/baz",
219 },
220 ]
221 `
222
223 exports[`test/place-dep.js TAP placement tests basic placement of a production dep with peer deps > warnings 1`] = `
224 Array []
225 `
226
227 exports[`test/place-dep.js TAP placement tests bounce off an existing dep that is newer, preferDedupe > changes to tree 1`] = `
228 --- expected
229 +++ actual
230 @@ -66,13 +66,6 @@
231 "spec": "2",
232 "from": "node_modules/a",
233 },
234 - EdgeIn {
235 - "type": "prod",
236 - "name": "b",
237 - "spec": "2.0.0",
238 - "error": "INVALID",
239 - "from": "node_modules/c",
240 - },
241 },
242 },
243 "c" => ArboristNode {
244 @@ -89,8 +82,7 @@
245 "type": "prod",
246 "name": "b",
247 "spec": "2.0.0",
248 - "to": "node_modules/b",
249 - "error": "INVALID",
250 + "to": "node_modules/c/node_modules/b",
251 },
252 },
253 "edgesIn": Set {
254 @@ -101,6 +93,52 @@
255 "from": "",
256 },
257 },
258 + "children": Map {
259 + "a" => ArboristNode {
260 + "name": "a",
261 + "version": "3.0.0",
262 + "location": "node_modules/c/node_modules/a",
263 + "path": "/some/path/node_modules/c/node_modules/a",
264 + "extraneous": true,
265 + "dev": true,
266 + "optional": true,
267 + "peer": true,
268 + "edgesIn": Set {
269 + EdgeIn {
270 + "type": "peer",
271 + "name": "a",
272 + "spec": "3",
273 + "from": "node_modules/c/node_modules/b",
274 + },
275 + },
276 + },
277 + "b" => ArboristNode {
278 + "name": "b",
279 + "version": "2.0.0",
280 + "location": "node_modules/c/node_modules/b",
281 + "path": "/some/path/node_modules/c/node_modules/b",
282 + "extraneous": true,
283 + "dev": true,
284 + "optional": true,
285 + "peer": true,
286 + "edgesOut": Map {
287 + "a" => EdgeOut {
288 + "type": "peer",
289 + "name": "a",
290 + "spec": "3",
291 + "to": "node_modules/c/node_modules/a",
292 + },
293 + },
294 + "edgesIn": Set {
295 + EdgeIn {
296 + "type": "prod",
297 + "name": "b",
298 + "spec": "2.0.0",
299 + "from": "node_modules/c",
300 + },
301 + },
302 + },
303 + },
304 },
305 },
306 }
307
308 `
309
310 exports[`test/place-dep.js TAP placement tests bounce off an existing dep that is newer, preferDedupe > placements 1`] = `
311 Array [
312 Object {
313 "canPlace": Symbol(OK),
314 "canPlaceSelf": Symbol(REPLACE),
315 "checks": Map {
316 "node_modules/c" => Array [
317 Symbol(OK),
318 Symbol(OK),
319 ],
320 "" => Array [
321 Symbol(CONFLICT),
322 Symbol(REPLACE),
323 ],
324 },
325 "dep": "[email protected]",
326 "edge": "{ node_modules/c prod [email protected] }",
327 "placed": "node_modules/c/node_modules/b",
328 },
329 Object {
330 "canPlace": Symbol(OK),
331 "canPlaceSelf": Symbol(OK),
332 "checks": Map {
333 "node_modules/c" => Array [
334 Symbol(OK),
335 Symbol(OK),
336 ],
337 "" => Array [
338 Symbol(CONFLICT),
339 Symbol(REPLACE),
340 ],
341 },
342 "dep": "[email protected]",
343 "edge": "{ node_modules/c/node_modules/b peer a@3 }",
344 "parent": "b",
345 "placed": "node_modules/c/node_modules/a",
346 },
347 ]
348 `
349
350 exports[`test/place-dep.js TAP placement tests bounce off an existing dep that is newer, preferDedupe > warnings 1`] = `
351 Array []
352 `
353
354 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer > changes to tree 1`] = `
355 --- expected
356 +++ actual
357 @@ -18,8 +18,7 @@
358 "type": "prod",
359 "name": "x",
360 "spec": "2",
361 - "to": null,
362 - "error": "MISSING",
363 + "to": "node_modules/x",
364 },
365 },
366 "children": Map {
367 @@ -63,6 +62,7 @@
368 "type": "prod",
369 "name": "y",
370 "spec": "1",
371 + "error": "INVALID",
372 "to": "node_modules/y",
373 },
374 },
375 @@ -75,9 +75,35 @@
376 },
377 },
378 },
379 + "x" => ArboristNode {
380 + "name": "x",
381 + "version": "2.0.0",
382 + "location": "node_modules/x",
383 + "path": "/some/path/node_modules/x",
384 + "extraneous": true,
385 + "dev": true,
386 + "optional": true,
387 + "peer": true,
388 + "edgesOut": Map {
389 + "y" => EdgeOut {
390 + "type": "peer",
391 + "name": "y",
392 + "spec": "2",
393 + "to": "node_modules/y",
394 + },
395 + },
396 + "edgesIn": Set {
397 + EdgeIn {
398 + "type": "prod",
399 + "name": "x",
400 + "spec": "2",
401 + "from": "",
402 + },
403 + },
404 + },
405 "y" => ArboristNode {
406 "name": "y",
407 - "version": "1.0.0",
408 + "version": "2.0.0",
409 "location": "node_modules/y",
410 "path": "/some/path/node_modules/y",
411 "extraneous": true,
412 @@ -89,8 +115,15 @@
413 "type": "prod",
414 "name": "y",
415 "spec": "1",
416 + "error": "INVALID",
417 "from": "node_modules/b",
418 },
419 + EdgeIn {
420 + "type": "peer",
421 + "name": "y",
422 + "spec": "2",
423 + "from": "node_modules/x",
424 + },
425 },
426 },
427 },
428
429 `
430
431 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer > placements 1`] = `
432 Array [
433 Object {
434 "canPlace": Symbol(OK),
435 "canPlaceSelf": Symbol(OK),
436 "checks": Map {
437 "" => Array [
438 Symbol(OK),
439 Symbol(OK),
440 ],
441 },
442 "dep": "[email protected]",
443 "edge": "{ ROOT prod x@2 }",
444 "placed": "node_modules/x",
445 },
446 Object {
447 "canPlace": Symbol(REPLACE),
448 "canPlaceSelf": Symbol(REPLACE),
449 "checks": Map {
450 "" => Array [
451 Symbol(OK),
452 Symbol(OK),
453 ],
454 },
455 "dep": "[email protected]",
456 "edge": "{ node_modules/x peer y@2 }",
457 "parent": "x",
458 "placed": "node_modules/y",
459 },
460 ]
461 `
462
463 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer > warnings 1`] = `
464 Array []
465 `
466
467 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer, step 2 > changes to tree 1`] = `
468 --- expected
469 +++ actual
470 @@ -62,6 +62,7 @@
471 "type": "prod",
472 "name": "y",
473 "spec": "1",
474 + "error": "INVALID",
475 "to": "node_modules/y",
476 },
477 },
478 @@ -89,7 +90,6 @@
479 "name": "y",
480 "spec": "2",
481 "to": "node_modules/y",
482 - "error": "INVALID",
483 },
484 },
485 "edgesIn": Set {
486 @@ -103,7 +103,7 @@
487 },
488 "y" => ArboristNode {
489 "name": "y",
490 - "version": "1.0.0",
491 + "version": "2.0.0",
492 "location": "node_modules/y",
493 "path": "/some/path/node_modules/y",
494 "extraneous": true,
495 @@ -115,13 +115,13 @@
496 "type": "prod",
497 "name": "y",
498 "spec": "1",
499 + "error": "INVALID",
500 "from": "node_modules/b",
501 },
502 EdgeIn {
503 "type": "peer",
504 "name": "y",
505 "spec": "2",
506 - "error": "INVALID",
507 "from": "node_modules/x",
508 },
509 },
510
511 `
512
513 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer, step 2 > placements 1`] = `
514 Array [
515 Object {
516 "canPlace": Symbol(REPLACE),
517 "canPlaceSelf": Symbol(REPLACE),
518 "checks": Map {
519 "" => Array [
520 Symbol(REPLACE),
521 Symbol(REPLACE),
522 ],
523 },
524 "dep": "[email protected]",
525 "edge": "{ node_modules/x peer y@2 }",
526 "placed": "node_modules/y",
527 },
528 ]
529 `
530
531 exports[`test/place-dep.js TAP placement tests clobber and nest a non-peer dep in favor of a root dep peer, step 2 > warnings 1`] = `
532 Array []
533 `
534
535 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep > changes to tree 1`] = `
536 --- expected
537 +++ actual
538 @@ -18,8 +18,7 @@
539 "type": "prod",
540 "name": "x",
541 "spec": "2",
542 - "to": null,
543 - "error": "MISSING",
544 + "to": "node_modules/x",
545 },
546 },
547 "children": Map {
548 @@ -37,7 +36,8 @@
549 "type": "prod",
550 "name": "b",
551 "spec": "1",
552 - "to": "node_modules/b",
553 + "error": "MISSING",
554 + "to": null,
555 },
556 },
557 "edgesIn": Set {
558 @@ -49,49 +49,49 @@
559 },
560 },
561 },
562 - "y" => ArboristNode {
563 - "name": "y",
564 - "version": "1.0.0",
565 - "location": "node_modules/y",
566 - "path": "/some/path/node_modules/y",
567 + "x" => ArboristNode {
568 + "name": "x",
569 + "version": "2.0.0",
570 + "location": "node_modules/x",
571 + "path": "/some/path/node_modules/x",
572 "extraneous": true,
573 "dev": true,
574 "optional": true,
575 "peer": true,
576 - "edgesIn": Set {
577 - EdgeIn {
578 + "edgesOut": Map {
579 + "y" => EdgeOut {
580 "type": "peer",
581 "name": "y",
582 - "spec": "1",
583 - "from": "node_modules/b",
584 + "spec": "2",
585 + "to": "node_modules/y",
586 },
587 },
588 + "edgesIn": Set {
589 + EdgeIn {
590 + "type": "prod",
591 + "name": "x",
592 + "spec": "2",
593 + "from": "",
594 + },
595 + },
596 },
597 - "b" => ArboristNode {
598 - "name": "b",
599 - "version": "1.0.0",
600 - "location": "node_modules/b",
601 - "path": "/some/path/node_modules/b",
602 + "y" => ArboristNode {
603 + "name": "y",
604 + "version": "2.0.0",
605 + "location": "node_modules/y",
606 + "path": "/some/path/node_modules/y",
607 "extraneous": true,
608 "dev": true,
609 "optional": true,
610 "peer": true,
611 - "edgesOut": Map {
612 - "y" => EdgeOut {
613 + "edgesIn": Set {
614 + EdgeIn {
615 "type": "peer",
616 "name": "y",
617 - "spec": "1",
618 - "to": "node_modules/y",
619 + "spec": "2",
620 + "from": "node_modules/x",
621 },
622 },
623 - "edgesIn": Set {
624 - EdgeIn {
625 - "type": "prod",
626 - "name": "b",
627 - "spec": "1",
628 - "from": "node_modules/a",
629 - },
630 - },
631 },
632 },
633 }
634
635 `
636
637 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep > placements 1`] = `
638 Array [
639 Object {
640 "canPlace": Symbol(OK),
641 "canPlaceSelf": Symbol(OK),
642 "checks": Map {
643 "" => Array [
644 Symbol(OK),
645 Symbol(OK),
646 ],
647 },
648 "dep": "[email protected]",
649 "edge": "{ ROOT prod x@2 }",
650 "placed": "node_modules/x",
651 },
652 Object {
653 "canPlace": Symbol(REPLACE),
654 "canPlaceSelf": Symbol(REPLACE),
655 "checks": Map {
656 "" => Array [
657 Symbol(OK),
658 Symbol(OK),
659 ],
660 },
661 "dep": "[email protected]",
662 "edge": "{ node_modules/x peer y@2 }",
663 "parent": "x",
664 "placed": "node_modules/y",
665 },
666 ]
667 `
668
669 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep > warnings 1`] = `
670 Array []
671 `
672
673 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep, step 2 > changes to tree 1`] = `
674 --- expected
675 +++ actual
676 @@ -36,7 +36,8 @@
677 "type": "prod",
678 "name": "b",
679 "spec": "1",
680 - "to": "node_modules/b",
681 + "error": "MISSING",
682 + "to": null,
683 },
684 },
685 "edgesIn": Set {
686 @@ -63,7 +64,6 @@
687 "name": "y",
688 "spec": "2",
689 "to": "node_modules/y",
690 - "error": "INVALID",
691 },
692 },
693 "edgesIn": Set {
694 @@ -77,7 +77,7 @@
695 },
696 "y" => ArboristNode {
697 "name": "y",
698 - "version": "1.0.0",
699 + "version": "2.0.0",
700 "location": "node_modules/y",
701 "path": "/some/path/node_modules/y",
702 "extraneous": true,
703 @@ -88,43 +88,10 @@
704 EdgeIn {
705 "type": "peer",
706 "name": "y",
707 - "spec": "1",
708 - "from": "node_modules/b",
709 - },
710 - EdgeIn {
711 - "type": "peer",
712 - "name": "y",
713 "spec": "2",
714 - "error": "INVALID",
715 "from": "node_modules/x",
716 },
717 },
718 },
719 - "b" => ArboristNode {
720 - "name": "b",
721 - "version": "1.0.0",
722 - "location": "node_modules/b",
723 - "path": "/some/path/node_modules/b",
724 - "extraneous": true,
725 - "dev": true,
726 - "optional": true,
727 - "peer": true,
728 - "edgesOut": Map {
729 - "y" => EdgeOut {
730 - "type": "peer",
731 - "name": "y",
732 - "spec": "1",
733 - "to": "node_modules/y",
734 - },
735 - },
736 - "edgesIn": Set {
737 - EdgeIn {
738 - "type": "prod",
739 - "name": "b",
740 - "spec": "1",
741 - "from": "node_modules/a",
742 - },
743 - },
744 - },
745 },
746 }
747
748 `
749
750 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep, step 2 > must match snapshot 1`] = `
751 Array [
752 "node_modules/a 1.0.0",
753 ]
754 `
755
756 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep, step 2 > placements 1`] = `
757 Array [
758 Object {
759 "canPlace": Symbol(REPLACE),
760 "canPlaceSelf": Symbol(REPLACE),
761 "checks": Map {
762 "" => Array [
763 Symbol(REPLACE),
764 Symbol(REPLACE),
765 ],
766 },
767 "dep": "[email protected]",
768 "edge": "{ node_modules/x peer y@2 }",
769 "placed": "node_modules/y",
770 },
771 ]
772 `
773
774 exports[`test/place-dep.js TAP placement tests clobber and nest a peer set in favor of a root dep, step 2 > warnings 1`] = `
775 Array []
776 `
777
778 exports[`test/place-dep.js TAP placement tests cycle of peers > changes to tree 1`] = `
779 --- expected
780 +++ actual
781 @@ -14,8 +14,93 @@
782 "type": "prod",
783 "name": "a",
784 "spec": "1.x",
785 - "to": null,
786 - "error": "MISSING",
787 + "to": "node_modules/a",
788 },
789 },
790 + "children": Map {
791 + "a" => ArboristNode {
792 + "name": "a",
793 + "version": "1.2.3",
794 + "location": "node_modules/a",
795 + "path": "/some/path/node_modules/a",
796 + "extraneous": true,
797 + "dev": true,
798 + "optional": true,
799 + "peer": true,
800 + "edgesOut": Map {
801 + "b" => EdgeOut {
802 + "type": "peer",
803 + "name": "b",
804 + "spec": "1",
805 + "to": "node_modules/b",
806 + },
807 + },
808 + "edgesIn": Set {
809 + EdgeIn {
810 + "type": "prod",
811 + "name": "a",
812 + "spec": "1.x",
813 + "from": "",
814 + },
815 + EdgeIn {
816 + "type": "peer",
817 + "name": "a",
818 + "spec": "1",
819 + "from": "node_modules/c",
820 + },
821 + },
822 + },
823 + "b" => ArboristNode {
824 + "name": "b",
825 + "version": "1.2.3",
826 + "location": "node_modules/b",
827 + "path": "/some/path/node_modules/b",
828 + "extraneous": true,
829 + "dev": true,
830 + "optional": true,
831 + "peer": true,
832 + "edgesOut": Map {
833 + "c" => EdgeOut {
834 + "type": "peer",
835 + "name": "c",
836 + "spec": "1",
837 + "to": "node_modules/c",
838 + },
839 + },
840 + "edgesIn": Set {
841 + EdgeIn {
842 + "type": "peer",
843 + "name": "b",
844 + "spec": "1",
845 + "from": "node_modules/a",
846 + },
847 + },
848 + },
849 + "c" => ArboristNode {
850 + "name": "c",
851 + "version": "1.2.3",
852 + "location": "node_modules/c",
853 + "path": "/some/path/node_modules/c",
854 + "extraneous": true,
855 + "dev": true,
856 + "optional": true,
857 + "peer": true,
858 + "edgesOut": Map {
859 + "a" => EdgeOut {
860 + "type": "peer",
861 + "name": "a",
862 + "spec": "1",
863 + "to": "node_modules/a",
864 + },
865 + },
866 + "edgesIn": Set {
867 + EdgeIn {
868 + "type": "peer",
869 + "name": "c",
870 + "spec": "1",
871 + "from": "node_modules/b",
872 + },
873 + },
874 + },
875 + },
876 }
877
878 `
879
880 exports[`test/place-dep.js TAP placement tests cycle of peers > placements 1`] = `
881 Array [
882 Object {
883 "canPlace": Symbol(OK),
884 "canPlaceSelf": Symbol(OK),
885 "checks": Map {
886 "" => Array [
887 Symbol(OK),
888 Symbol(OK),
889 ],
890 },
891 "dep": "[email protected]",
892 "edge": "{ ROOT prod [email protected] }",
893 "placed": "node_modules/a",
894 },
895 Object {
896 "canPlace": Symbol(OK),
897 "canPlaceSelf": Symbol(OK),
898 "checks": Map {
899 "" => Array [
900 Symbol(OK),
901 Symbol(OK),
902 ],
903 },
904 "dep": "[email protected]",
905 "edge": "{ node_modules/a peer b@1 }",
906 "parent": "a",
907 "placed": "node_modules/b",
908 },
909 Object {
910 "canPlace": Symbol(OK),
911 "canPlaceSelf": Symbol(OK),
912 "checks": Map {
913 "" => Array [
914 Symbol(OK),
915 Symbol(OK),
916 ],
917 },
918 "dep": "[email protected]",
919 "edge": "{ node_modules/b peer c@1 }",
920 "parent": "b",
921 "placed": "node_modules/c",
922 },
923 ]
924 `
925
926 exports[`test/place-dep.js TAP placement tests cycle of peers > warnings 1`] = `
927 Array []
928 `
929
930 exports[`test/place-dep.js TAP placement tests cycle of peers hanging off entry node > changes to tree 1`] = `
931 --- expected
932 +++ actual
933 @@ -14,8 +14,119 @@
934 "type": "prod",
935 "name": "a",
936 "spec": "1.x",
937 - "to": null,
938 - "error": "MISSING",
939 + "to": "node_modules/a",
940 },
941 },
942 + "children": Map {
943 + "a" => ArboristNode {
944 + "name": "a",
945 + "version": "1.2.3",
946 + "location": "node_modules/a",
947 + "path": "/some/path/node_modules/a",
948 + "extraneous": true,
949 + "dev": true,
950 + "optional": true,
951 + "peer": true,
952 + "edgesOut": Map {
953 + "b" => EdgeOut {
954 + "type": "peer",
955 + "name": "b",
956 + "spec": "1",
957 + "to": "node_modules/b",
958 + },
959 + },
960 + "edgesIn": Set {
961 + EdgeIn {
962 + "type": "prod",
963 + "name": "a",
964 + "spec": "1.x",
965 + "from": "",
966 + },
967 + },
968 + },
969 + "b" => ArboristNode {
970 + "name": "b",
971 + "version": "1.2.3",
972 + "location": "node_modules/b",
973 + "path": "/some/path/node_modules/b",
974 + "extraneous": true,
975 + "dev": true,
976 + "optional": true,
977 + "peer": true,
978 + "edgesOut": Map {
979 + "c" => EdgeOut {
980 + "type": "peer",
981 + "name": "c",
982 + "spec": "1",
983 + "to": "node_modules/c",
984 + },
985 + },
986 + "edgesIn": Set {
987 + EdgeIn {
988 + "type": "peer",
989 + "name": "b",
990 + "spec": "1",
991 + "from": "node_modules/a",
992 + },
993 + EdgeIn {
994 + "type": "peer",
995 + "name": "b",
996 + "spec": "1",
997 + "from": "node_modules/d",
998 + },
999 + },
1000 + },
1001 + "c" => ArboristNode {
1002 + "name": "c",
1003 + "version": "1.2.3",
1004 + "location": "node_modules/c",
1005 + "path": "/some/path/node_modules/c",
1006 + "extraneous": true,
1007 + "dev": true,
1008 + "optional": true,
1009 + "peer": true,
1010 + "edgesOut": Map {
1011 + "d" => EdgeOut {
1012 + "type": "peer",
1013 + "name": "d",
1014 + "spec": "1",
1015 + "to": "node_modules/d",
1016 + },
1017 + },
1018 + "edgesIn": Set {
1019 + EdgeIn {
1020 + "type": "peer",
1021 + "name": "c",
1022 + "spec": "1",
1023 + "from": "node_modules/b",
1024 + },
1025 + },
1026 + },
1027 + "d" => ArboristNode {
1028 + "name": "d",
1029 + "version": "1.2.3",
1030 + "location": "node_modules/d",
1031 + "path": "/some/path/node_modules/d",
1032 + "extraneous": true,
1033 + "dev": true,
1034 + "optional": true,
1035 + "peer": true,
1036 + "edgesOut": Map {
1037 + "b" => EdgeOut {
1038 + "type": "peer",
1039 + "name": "b",
1040 + "spec": "1",
1041 + "to": "node_modules/b",
1042 + },
1043 + },
1044 + "edgesIn": Set {
1045 + EdgeIn {
1046 + "type": "peer",
1047 + "name": "d",
1048 + "spec": "1",
1049 + "from": "node_modules/c",
1050 + },
1051 + },
1052 + },
1053 + },
1054 }
1055
1056 `
1057
1058 exports[`test/place-dep.js TAP placement tests cycle of peers hanging off entry node > placements 1`] = `
1059 Array [
1060 Object {
1061 "canPlace": Symbol(OK),
1062 "canPlaceSelf": Symbol(OK),
1063 "checks": Map {
1064 "" => Array [
1065 Symbol(OK),
1066 Symbol(OK),
1067 ],
1068 },
1069 "dep": "[email protected]",
1070 "edge": "{ ROOT prod [email protected] }",
1071 "placed": "node_modules/a",
1072 },
1073 Object {
1074 "canPlace": Symbol(OK),
1075 "canPlaceSelf": Symbol(OK),
1076 "checks": Map {
1077 "" => Array [
1078 Symbol(OK),
1079 Symbol(OK),
1080 ],
1081 },
1082 "dep": "[email protected]",
1083 "edge": "{ node_modules/a peer b@1 }",
1084 "parent": "a",
1085 "placed": "node_modules/b",
1086 },
1087 Object {
1088 "canPlace": Symbol(OK),
1089 "canPlaceSelf": Symbol(OK),
1090 "checks": Map {
1091 "" => Array [
1092 Symbol(OK),
1093 Symbol(OK),
1094 ],
1095 },
1096 "dep": "[email protected]",
1097 "edge": "{ node_modules/b peer c@1 }",
1098 "parent": "b",
1099 "placed": "node_modules/c",
1100 },
1101 Object {
1102 "canPlace": Symbol(OK),
1103 "canPlaceSelf": Symbol(OK),
1104 "checks": Map {
1105 "" => Array [
1106 Symbol(OK),
1107 Symbol(OK),
1108 ],
1109 },
1110 "dep": "[email protected]",
1111 "edge": "{ node_modules/c peer d@1 }",
1112 "parent": "c",
1113 "placed": "node_modules/d",
1114 },
1115 ]
1116 `
1117
1118 exports[`test/place-dep.js TAP placement tests cycle of peers hanging off entry node > warnings 1`] = `
1119 Array []
1120 `
1121
1122 exports[`test/place-dep.js TAP placement tests dedupe a transitive dependency > changes to tree 1`] = `
1123 --- expected
1124 +++ actual
1125 @@ -22,6 +22,30 @@
1126 },
1127 },
1128 "children": Map {
1129 + "bar" => ArboristNode {
1130 + "name": "bar",
1131 + "version": "1.0.0",
1132 + "location": "node_modules/bar",
1133 + "path": "/some/path/node_modules/bar",
1134 + "extraneous": true,
1135 + "dev": true,
1136 + "optional": true,
1137 + "peer": true,
1138 + "edgesIn": Set {
1139 + EdgeIn {
1140 + "type": "prod",
1141 + "name": "bar",
1142 + "spec": "1",
1143 + "from": "node_modules/baz",
1144 + },
1145 + EdgeIn {
1146 + "type": "prod",
1147 + "name": "bar",
1148 + "spec": "1",
1149 + "from": "node_modules/foo",
1150 + },
1151 + },
1152 + },
1153 "baz" => ArboristNode {
1154 "name": "baz",
1155 "version": "1.0.0",
1156 @@ -36,8 +60,7 @@
1157 "type": "prod",
1158 "name": "bar",
1159 "spec": "1",
1160 - "to": null,
1161 - "error": "MISSING",
1162 + "to": "node_modules/bar",
1163 },
1164 },
1165 "edgesIn": Set {
1166 @@ -63,8 +86,7 @@
1167 "type": "prod",
1168 "name": "bar",
1169 "spec": "1",
1170 - "to": null,
1171 - "error": "MISSING",
1172 + "to": "node_modules/bar",
1173 },
1174 },
1175 "edgesIn": Set {
1176
1177 `
1178
1179 exports[`test/place-dep.js TAP placement tests dedupe a transitive dependency > placements 1`] = `
1180 Array [
1181 Object {
1182 "canPlace": Symbol(OK),
1183 "canPlaceSelf": Symbol(OK),
1184 "checks": Map {
1185 "node_modules/foo" => Array [
1186 Symbol(OK),
1187 Symbol(OK),
1188 ],
1189 "" => Array [
1190 Symbol(OK),
1191 Symbol(OK),
1192 ],
1193 },
1194 "dep": "[email protected]",
1195 "edge": "{ node_modules/foo prod bar@1 }",
1196 "placed": "node_modules/bar",
1197 },
1198 ]
1199 `
1200
1201 exports[`test/place-dep.js TAP placement tests dedupe a transitive dependency > warnings 1`] = `
1202 Array []
1203 `
1204
1205 exports[`test/place-dep.js TAP placement tests dep with load error > changes to tree 1`] = `
1206 --- expected
1207 +++ actual
1208 @@ -12,9 +12,35 @@
1209 "type": "prod",
1210 "name": "foo",
1211 "spec": "1",
1212 - "error": "MISSING",
1213 + "error": "INVALID",
1214 "peerConflicted": true,
1215 - "to": null,
1216 + "to": "node_modules/foo",
1217 },
1218 },
1219 + "children": Map {
1220 + "foo" => ArboristNode {
1221 + "name": "foo",
1222 + "location": "node_modules/foo",
1223 + "path": "/some/path/node_modules/foo",
1224 + "extraneous": true,
1225 + "dev": true,
1226 + "optional": true,
1227 + "peer": true,
1228 + "errors": Array [
1229 + Object {
1230 + "code": "testing",
1231 + },
1232 + ],
1233 + "edgesIn": Set {
1234 + EdgeIn {
1235 + "type": "prod",
1236 + "name": "foo",
1237 + "spec": "1",
1238 + "error": "INVALID",
1239 + "peerConflicted": true,
1240 + "from": "",
1241 + },
1242 + },
1243 + },
1244 + },
1245 }
1246
1247 `
1248
1249 exports[`test/place-dep.js TAP placement tests dep with load error > placements 1`] = `
1250 Array [
1251 Object {
1252 "canPlace": Symbol(OK),
1253 "canPlaceSelf": Symbol(OK),
1254 "checks": Map {
1255 "" => Array [
1256 Symbol(OK),
1257 Symbol(OK),
1258 ],
1259 },
1260 "dep": "foo@",
1261 "edge": "{ ROOT prod foo@1 }",
1262 "placed": "node_modules/foo",
1263 },
1264 ]
1265 `
1266
1267 exports[`test/place-dep.js TAP placement tests dep with load error > warnings 1`] = `
1268 Array []
1269 `
1270
1271 exports[`test/place-dep.js TAP placement tests do not shadow inappropriately > changes to tree 1`] = `
1272 --- expected
1273 +++ actual
1274 @@ -56,13 +56,6 @@
1275 "spec": "1",
1276 "from": "node_modules/x/node_modules/b",
1277 },
1278 - EdgeIn {
1279 - "type": "prod",
1280 - "name": "c",
1281 - "spec": "2",
1282 - "error": "INVALID",
1283 - "from": "node_modules/x/node_modules/a/node_modules/b",
1284 - },
1285 },
1286 },
1287 "x" => ArboristNode {
1288 @@ -137,8 +130,7 @@
1289 "type": "prod",
1290 "name": "c",
1291 "spec": "2",
1292 - "to": "node_modules/c",
1293 - "error": "INVALID",
1294 + "to": "node_modules/x/node_modules/a/node_modules/c",
1295 },
1296 },
1297 "edgesIn": Set {
1298 @@ -150,6 +142,24 @@
1299 },
1300 },
1301 },
1302 + "c" => ArboristNode {
1303 + "name": "c",
1304 + "version": "2.0.0",
1305 + "location": "node_modules/x/node_modules/a/node_modules/c",
1306 + "path": "/some/path/node_modules/x/node_modules/a/node_modules/c",
1307 + "extraneous": true,
1308 + "dev": true,
1309 + "optional": true,
1310 + "peer": true,
1311 + "edgesIn": Set {
1312 + EdgeIn {
1313 + "type": "prod",
1314 + "name": "c",
1315 + "spec": "2",
1316 + "from": "node_modules/x/node_modules/a/node_modules/b",
1317 + },
1318 + },
1319 + },
1320 },
1321 },
1322 "b" => ArboristNode {
1323
1324 `
1325
1326 exports[`test/place-dep.js TAP placement tests do not shadow inappropriately > placements 1`] = `
1327 Array [
1328 Object {
1329 "canPlace": Symbol(OK),
1330 "canPlaceSelf": Symbol(OK),
1331 "checks": Map {
1332 "node_modules/x/node_modules/a/node_modules/b" => Array [
1333 Symbol(OK),
1334 Symbol(OK),
1335 ],
1336 "node_modules/x/node_modules/a" => Array [
1337 Symbol(OK),
1338 Symbol(OK),
1339 ],
1340 "node_modules/x" => Array [
1341 Symbol(CONFLICT),
1342 Symbol(CONFLICT),
1343 ],
1344 },
1345 "dep": "[email protected]",
1346 "edge": "{ node_modules/x/node_modules/a/node_modules/b prod c@2 }",
1347 "placed": "node_modules/x/node_modules/a/node_modules/c",
1348 },
1349 ]
1350 `
1351
1352 exports[`test/place-dep.js TAP placement tests do not shadow inappropriately > warnings 1`] = `
1353 Array []
1354 `
1355
1356 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, but new dep set can > changes to tree 1`] = `
1357 --- expected
1358 +++ actual
1359 @@ -38,8 +38,7 @@
1360 "type": "prod",
1361 "name": "b",
1362 "spec": "1",
1363 - "to": "node_modules/b",
1364 - "error": "INVALID",
1365 + "to": "node_modules/a/node_modules/b",
1366 },
1367 },
1368 "edgesIn": Set {
1369 @@ -50,6 +49,52 @@
1370 "from": "",
1371 },
1372 },
1373 + "children": Map {
1374 + "b" => ArboristNode {
1375 + "name": "b",
1376 + "version": "1.0.1",
1377 + "location": "node_modules/a/node_modules/b",
1378 + "path": "/some/path/node_modules/a/node_modules/b",
1379 + "extraneous": true,
1380 + "dev": true,
1381 + "optional": true,
1382 + "peer": true,
1383 + "edgesOut": Map {
1384 + "c" => EdgeOut {
1385 + "type": "peer",
1386 + "name": "c",
1387 + "spec": "1",
1388 + "to": "node_modules/a/node_modules/c",
1389 + },
1390 + },
1391 + "edgesIn": Set {
1392 + EdgeIn {
1393 + "type": "prod",
1394 + "name": "b",
1395 + "spec": "1",
1396 + "from": "node_modules/a",
1397 + },
1398 + },
1399 + },
1400 + "c" => ArboristNode {
1401 + "name": "c",
1402 + "version": "1.0.1",
1403 + "location": "node_modules/a/node_modules/c",
1404 + "path": "/some/path/node_modules/a/node_modules/c",
1405 + "extraneous": true,
1406 + "dev": true,
1407 + "optional": true,
1408 + "peer": true,
1409 + "edgesIn": Set {
1410 + EdgeIn {
1411 + "type": "peer",
1412 + "name": "c",
1413 + "spec": "1",
1414 + "from": "node_modules/a/node_modules/b",
1415 + },
1416 + },
1417 + },
1418 + },
1419 },
1420 "b" => ArboristNode {
1421 "name": "b",
1422 @@ -75,13 +120,6 @@
1423 "spec": "2",
1424 "from": "node_modules/d",
1425 },
1426 - EdgeIn {
1427 - "type": "prod",
1428 - "name": "b",
1429 - "spec": "1",
1430 - "error": "INVALID",
1431 - "from": "node_modules/a",
1432 - },
1433 },
1434 },
1435 "c" => ArboristNode {
1436
1437 `
1438
1439 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, but new dep set can > placements 1`] = `
1440 Array [
1441 Object {
1442 "canPlace": Symbol(OK),
1443 "canPlaceSelf": Symbol(OK),
1444 "checks": Map {
1445 "node_modules/a" => Array [
1446 Symbol(OK),
1447 Symbol(OK),
1448 ],
1449 "" => Array [
1450 Symbol(CONFLICT),
1451 Symbol(CONFLICT),
1452 ],
1453 },
1454 "dep": "[email protected]",
1455 "edge": "{ node_modules/a prod b@1 }",
1456 "placed": "node_modules/a/node_modules/b",
1457 },
1458 Object {
1459 "canPlace": Symbol(OK),
1460 "canPlaceSelf": Symbol(OK),
1461 "checks": Map {
1462 "node_modules/a" => Array [
1463 Symbol(OK),
1464 Symbol(OK),
1465 ],
1466 "" => Array [
1467 Symbol(CONFLICT),
1468 Symbol(CONFLICT),
1469 ],
1470 },
1471 "dep": "[email protected]",
1472 "edge": "{ node_modules/a/node_modules/b peer c@1 }",
1473 "parent": "b",
1474 "placed": "node_modules/a/node_modules/c",
1475 },
1476 ]
1477 `
1478
1479 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, but new dep set can > warnings 1`] = `
1480 Array []
1481 `
1482
1483 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set > thrown error 1`] = `
1484 Error: could not resolve {
1485 "code": "ERESOLVE",
1486 "current": Object {
1487 "dependents": Array [
1488 Object {
1489 "from": Object {
1490 "dependents": Array [
1491 Object {
1492 "from": Object {
1493 "location": "/some/path",
1494 },
1495 "name": "d",
1496 "spec": "2.x",
1497 "type": "prod",
1498 },
1499 ],
1500 "isWorkspace": false,
1501 "location": "node_modules/d",
1502 "name": "d",
1503 "version": "2.2.2",
1504 },
1505 "name": "b",
1506 "spec": "2",
1507 "type": "peer",
1508 },
1509 ],
1510 "isWorkspace": false,
1511 "location": "node_modules/b",
1512 "name": "b",
1513 "version": "2.2.2",
1514 },
1515 "dep": Object {
1516 "dependents": Array [
1517 Object {
1518 "error": "INVALID",
1519 "from": Object {
1520 "dependents": Array [
1521 Object {
1522 "from": Object {
1523 "location": "/some/path",
1524 },
1525 "name": "a",
1526 "spec": "1.x",
1527 "type": "prod",
1528 },
1529 ],
1530 "isWorkspace": false,
1531 "location": "node_modules/a",
1532 "name": "a",
1533 "version": "1.0.1",
1534 },
1535 "name": "b",
1536 "spec": "1",
1537 "type": "peer",
1538 },
1539 ],
1540 "isWorkspace": false,
1541 "location": "node_modules/b",
1542 "name": "b",
1543 "version": "1.0.1",
1544 "whileInstalling": Object {
1545 "name": "a",
1546 "path": "/some/path/node_modules/a",
1547 "version": "1.0.1",
1548 },
1549 },
1550 "edge": Object {
1551 "error": "INVALID",
1552 "from": Object {
1553 "dependents": Array [
1554 Object {
1555 "from": Object {
1556 "location": "/some/path",
1557 },
1558 "name": "a",
1559 "spec": "1.x",
1560 "type": "prod",
1561 },
1562 ],
1563 "isWorkspace": false,
1564 "location": "node_modules/a",
1565 "name": "a",
1566 "version": "1.0.1",
1567 },
1568 "name": "b",
1569 "spec": "1",
1570 "type": "peer",
1571 },
1572 "force": false,
1573 "isMine": true,
1574 "name": "Error",
1575 "peerConflict": Object {
1576 "current": Object {
1577 "dependents": Array [
1578 Object {
1579 "from": Object {
1580 "dependents": Array [
1581 Object {
1582 "from": Object {
1583 "location": "/some/path",
1584 },
1585 "name": "d",
1586 "spec": "2.x",
1587 "type": "prod",
1588 },
1589 ],
1590 "isWorkspace": false,
1591 "location": "node_modules/d",
1592 "name": "d",
1593 "version": "2.2.2",
1594 },
1595 "name": "b",
1596 "spec": "2",
1597 "type": "peer",
1598 },
1599 ],
1600 "isWorkspace": false,
1601 "location": "node_modules/b",
1602 "name": "b",
1603 "version": "2.2.2",
1604 },
1605 "peer": Object {
1606 "dependents": Array [
1607 Object {
1608 "error": "INVALID",
1609 "from": Object {
1610 "dependents": Array [
1611 Object {
1612 "from": Object {
1613 "location": "/some/path",
1614 },
1615 "name": "a",
1616 "spec": "1.x",
1617 "type": "prod",
1618 },
1619 ],
1620 "isWorkspace": false,
1621 "location": "node_modules/a",
1622 "name": "a",
1623 "version": "1.0.1",
1624 },
1625 "name": "b",
1626 "spec": "1",
1627 "type": "peer",
1628 },
1629 ],
1630 "isWorkspace": false,
1631 "location": "node_modules/b",
1632 "name": "b",
1633 "version": "1.0.1",
1634 "whileInstalling": Object {
1635 "name": "a",
1636 "path": "/some/path/node_modules/a",
1637 "version": "1.0.1",
1638 },
1639 },
1640 },
1641 "strictPeerDeps": false,
1642 }
1643 `
1644
1645 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer > thrown error 1`] = `
1646 Error: could not resolve {
1647 "code": "ERESOLVE",
1648 "current": Object {
1649 "dependents": Array [
1650 Object {
1651 "from": Object {
1652 "location": "/some/path",
1653 },
1654 "name": "d",
1655 "spec": "1.x",
1656 "type": "prod",
1657 },
1658 ],
1659 "isWorkspace": false,
1660 "location": "node_modules/d",
1661 "name": "d",
1662 "version": "1.1.1",
1663 },
1664 "dep": Object {
1665 "dependents": Array [
1666 Object {
1667 "from": Object {
1668 "location": "/some/path",
1669 },
1670 "name": "d",
1671 "spec": "1.x",
1672 "type": "prod",
1673 },
1674 ],
1675 "isWorkspace": false,
1676 "location": "node_modules/d",
1677 "name": "d",
1678 "version": "1.2.2",
1679 "whileInstalling": Object {
1680 "name": "project",
1681 "path": "/some/path",
1682 "version": "1.2.3",
1683 },
1684 },
1685 "edge": Object {
1686 "from": Object {
1687 "location": "/some/path",
1688 },
1689 "name": "d",
1690 "spec": "1.x",
1691 "type": "prod",
1692 },
1693 "force": false,
1694 "isMine": true,
1695 "name": "Error",
1696 "peerConflict": Object {
1697 "current": Object {
1698 "dependents": Array [
1699 Object {
1700 "from": Object {
1701 "dependents": Array [
1702 Object {
1703 "from": Object {
1704 "location": "/some/path",
1705 },
1706 "name": "a",
1707 "spec": "1.x",
1708 "type": "prod",
1709 },
1710 ],
1711 "isWorkspace": false,
1712 "location": "node_modules/a",
1713 "name": "a",
1714 "version": "1.0.1",
1715 },
1716 "name": "c",
1717 "spec": "*",
1718 "type": "peer",
1719 },
1720 Object {
1721 "from": Object {
1722 "dependents": Array [
1723 Object {
1724 "from": Object {
1725 "dependents": Array [
1726 Object {
1727 "from": Object {
1728 "location": "/some/path",
1729 },
1730 "name": "a",
1731 "spec": "1.x",
1732 "type": "prod",
1733 },
1734 ],
1735 "isWorkspace": false,
1736 "location": "node_modules/a",
1737 "name": "a",
1738 "version": "1.0.1",
1739 },
1740 "name": "bb",
1741 "spec": "1",
1742 "type": "prod",
1743 },
1744 ],
1745 "isWorkspace": false,
1746 "location": "node_modules/bb",
1747 "name": "bb",
1748 "version": "1.0.1",
1749 },
1750 "name": "c",
1751 "spec": "*",
1752 "type": "peer",
1753 },
1754 Object {
1755 "from": Object {
1756 "dependents": Array [
1757 Object {
1758 "from": Object {
1759 "dependents": Array [
1760 Object {
1761 "from": Object {
1762 "dependents": Array [
1763 Object {
1764 "from": Object {
1765 "dependents": Array [
1766 Object {
1767 "from": Object {
1768 "location": "/some/path",
1769 },
1770 "name": "a",
1771 "spec": "1.x",
1772 "type": "prod",
1773 },
1774 ],
1775 "isWorkspace": false,
1776 "location": "node_modules/a",
1777 "name": "a",
1778 "version": "1.0.1",
1779 },
1780 "name": "bb",
1781 "spec": "1",
1782 "type": "prod",
1783 },
1784 ],
1785 "isWorkspace": false,
1786 "location": "node_modules/bb",
1787 "name": "bb",
1788 "version": "1.0.1",
1789 },
1790 "name": "cc",
1791 "spec": "1",
1792 "type": "prod",
1793 },
1794 ],
1795 "isWorkspace": false,
1796 "location": "node_modules/cc",
1797 "name": "cc",
1798 "version": "1.0.1",
1799 },
1800 "name": "dd",
1801 "spec": "1",
1802 "type": "peer",
1803 },
1804 ],
1805 "isWorkspace": false,
1806 "location": "node_modules/dd",
1807 "name": "dd",
1808 "version": "1.0.1",
1809 },
1810 "name": "c",
1811 "spec": "1",
1812 "type": "peer",
1813 },
1814 Object {
1815 "from": Object {
1816 "dependents": Array [
1817 Object {
1818 "from": Object {
1819 "location": "/some/path",
1820 },
1821 "name": "d",
1822 "spec": "1.x",
1823 "type": "prod",
1824 },
1825 ],
1826 "isWorkspace": false,
1827 "location": "node_modules/d",
1828 "name": "d",
1829 "version": "1.1.1",
1830 },
1831 "name": "c",
1832 "spec": "1",
1833 "type": "peer",
1834 },
1835 ],
1836 "isWorkspace": false,
1837 "location": "node_modules/c",
1838 "name": "c",
1839 "version": "1.0.1",
1840 },
1841 "peer": Object {
1842 "dependents": Array [
1843 Object {
1844 "from": Object {
1845 "dependents": Array [
1846 Object {
1847 "from": Object {
1848 "dependents": Array [
1849 Object {
1850 "from": Object {
1851 "location": "/some/path",
1852 },
1853 "name": "d",
1854 "spec": "1.x",
1855 "type": "prod",
1856 },
1857 ],
1858 "isWorkspace": false,
1859 "location": "node_modules/d",
1860 "name": "d",
1861 "version": "1.2.2",
1862 "whileInstalling": Object {
1863 "name": "project",
1864 "path": "/some/path",
1865 "version": "1.2.3",
1866 },
1867 },
1868 "name": "b",
1869 "spec": "2",
1870 "type": "peer",
1871 },
1872 ],
1873 "isWorkspace": false,
1874 "location": "node_modules/b",
1875 "name": "b",
1876 "version": "2.2.2",
1877 "whileInstalling": Object {
1878 "name": "project",
1879 "path": "/some/path",
1880 "version": "1.2.3",
1881 },
1882 },
1883 "name": "c",
1884 "spec": "2",
1885 "type": "peer",
1886 },
1887 ],
1888 "isWorkspace": false,
1889 "location": "node_modules/c",
1890 "name": "c",
1891 "version": "2.2.2",
1892 "whileInstalling": Object {
1893 "name": "project",
1894 "path": "/some/path",
1895 "version": "1.2.3",
1896 },
1897 },
1898 },
1899 "strictPeerDeps": false,
1900 }
1901 `
1902
1903 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, force > changes to tree 1`] = `
1904 --- expected
1905 +++ actual
1906 @@ -116,12 +116,6 @@
1907 "spec": "1",
1908 "from": "node_modules/dd",
1909 },
1910 - EdgeIn {
1911 - "type": "peer",
1912 - "name": "c",
1913 - "spec": "1",
1914 - "from": "node_modules/d",
1915 - },
1916 },
1917 },
1918 "cc" => ArboristNode {
1919 @@ -152,7 +146,7 @@
1920 },
1921 "d" => ArboristNode {
1922 "name": "d",
1923 - "version": "1.1.1",
1924 + "version": "1.2.2",
1925 "location": "node_modules/d",
1926 "path": "/some/path/node_modules/d",
1927 "extraneous": true,
1928 @@ -160,11 +154,12 @@
1929 "optional": true,
1930 "peer": true,
1931 "edgesOut": Map {
1932 - "c" => EdgeOut {
1933 + "b" => EdgeOut {
1934 "type": "peer",
1935 - "name": "c",
1936 - "spec": "1",
1937 - "to": "node_modules/c",
1938 + "name": "b",
1939 + "spec": "2",
1940 + "error": "MISSING",
1941 + "to": null,
1942 },
1943 },
1944 "edgesIn": Set {
1945
1946 `
1947
1948 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, force > placements 1`] = `
1949 Array [
1950 Object {
1951 "canPlace": Symbol(REPLACE),
1952 "canPlaceSelf": Symbol(REPLACE),
1953 "checks": Map {
1954 "" => Array [
1955 Symbol(REPLACE),
1956 Symbol(REPLACE),
1957 ],
1958 },
1959 "dep": "[email protected]",
1960 "edge": "{ ROOT prod [email protected] }",
1961 "placed": "node_modules/d",
1962 },
1963 ]
1964 `
1965
1966 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, force > warnings 1`] = `
1967 Array []
1968 `
1969
1970 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, legacyPeerDeps > changes to tree 1`] = `
1971 --- expected
1972 +++ actual
1973 @@ -161,15 +161,6 @@
1974 "from": "",
1975 },
1976 },
1977 - "edgesOut": Map {
1978 - "b" => EdgeOut {
1979 - "type": "peer",
1980 - "name": "b",
1981 - "spec": "2",
1982 - "error": "MISSING",
1983 - "to": null,
1984 - },
1985 - },
1986 },
1987 "dd" => ArboristNode {
1988 "name": "dd",
1989
1990 `
1991
1992 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, legacyPeerDeps > placements 1`] = `
1993 Array [
1994 Object {
1995 "canPlace": Symbol(REPLACE),
1996 "canPlaceSelf": Symbol(REPLACE),
1997 "checks": Map {
1998 "" => Array [
1999 Symbol(REPLACE),
2000 Symbol(REPLACE),
2001 ],
2002 },
2003 "dep": "[email protected]",
2004 "edge": "{ ROOT prod [email protected] }",
2005 "placed": "node_modules/d",
2006 },
2007 ]
2008 `
2009
2010 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on deep peer, legacyPeerDeps > warnings 1`] = `
2011 Array []
2012 `
2013
2014 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz > thrown error 1`] = `
2015 Error: could not resolve {
2016 "code": "ERESOLVE",
2017 "current": Object {
2018 "dependents": Array [
2019 Object {
2020 "from": Object {
2021 "location": "/some/path",
2022 },
2023 "name": "d",
2024 "spec": "1.x",
2025 "type": "prod",
2026 },
2027 ],
2028 "isWorkspace": false,
2029 "location": "node_modules/d",
2030 "name": "d",
2031 "version": "1.1.1",
2032 },
2033 "dep": Object {
2034 "dependents": Array [
2035 Object {
2036 "from": Object {
2037 "location": "/some/path",
2038 },
2039 "name": "d",
2040 "spec": "1.x",
2041 "type": "prod",
2042 },
2043 ],
2044 "isWorkspace": false,
2045 "location": "node_modules/d",
2046 "name": "d",
2047 "version": "1.2.2",
2048 "whileInstalling": Object {
2049 "name": "project",
2050 "path": "/some/path",
2051 "version": "1.2.3",
2052 },
2053 },
2054 "edge": Object {
2055 "from": Object {
2056 "location": "/some/path",
2057 },
2058 "name": "d",
2059 "spec": "1.x",
2060 "type": "prod",
2061 },
2062 "force": false,
2063 "isMine": true,
2064 "name": "Error",
2065 "peerConflict": Object {
2066 "current": Object {
2067 "dependents": Array [
2068 Object {
2069 "from": Object {
2070 "dependents": Array [
2071 Object {
2072 "from": Object {
2073 "location": "/some/path",
2074 },
2075 "name": "a",
2076 "spec": "1.x",
2077 "type": "prod",
2078 },
2079 ],
2080 "isWorkspace": false,
2081 "location": "node_modules/a",
2082 "name": "a",
2083 "version": "1.0.1",
2084 },
2085 "name": "c",
2086 "spec": "*",
2087 "type": "peer",
2088 },
2089 Object {
2090 "from": Object {
2091 "dependents": Array [
2092 Object {
2093 "from": Object {
2094 "dependents": Array [
2095 Object {
2096 "from": Object {
2097 "location": "/some/path",
2098 },
2099 "name": "a",
2100 "spec": "1.x",
2101 "type": "prod",
2102 },
2103 ],
2104 "isWorkspace": false,
2105 "location": "node_modules/a",
2106 "name": "a",
2107 "version": "1.0.1",
2108 },
2109 "name": "bb",
2110 "spec": "1",
2111 "type": "prod",
2112 },
2113 ],
2114 "isWorkspace": false,
2115 "location": "node_modules/bb",
2116 "name": "bb",
2117 "version": "1.0.1",
2118 },
2119 "name": "c",
2120 "spec": "1",
2121 "type": "peer",
2122 },
2123 Object {
2124 "from": Object {
2125 "dependents": Array [
2126 Object {
2127 "from": Object {
2128 "location": "/some/path",
2129 },
2130 "name": "d",
2131 "spec": "1.x",
2132 "type": "prod",
2133 },
2134 ],
2135 "isWorkspace": false,
2136 "location": "node_modules/d",
2137 "name": "d",
2138 "version": "1.1.1",
2139 },
2140 "name": "c",
2141 "spec": "1",
2142 "type": "peer",
2143 },
2144 ],
2145 "isWorkspace": false,
2146 "location": "node_modules/c",
2147 "name": "c",
2148 "version": "1.0.1",
2149 },
2150 "peer": Object {
2151 "dependents": Array [
2152 Object {
2153 "from": Object {
2154 "dependents": Array [
2155 Object {
2156 "from": Object {
2157 "dependents": Array [
2158 Object {
2159 "from": Object {
2160 "location": "/some/path",
2161 },
2162 "name": "d",
2163 "spec": "1.x",
2164 "type": "prod",
2165 },
2166 ],
2167 "isWorkspace": false,
2168 "location": "node_modules/d",
2169 "name": "d",
2170 "version": "1.2.2",
2171 "whileInstalling": Object {
2172 "name": "project",
2173 "path": "/some/path",
2174 "version": "1.2.3",
2175 },
2176 },
2177 "name": "b",
2178 "spec": "2",
2179 "type": "peer",
2180 },
2181 ],
2182 "isWorkspace": false,
2183 "location": "node_modules/b",
2184 "name": "b",
2185 "version": "2.2.2",
2186 "whileInstalling": Object {
2187 "name": "project",
2188 "path": "/some/path",
2189 "version": "1.2.3",
2190 },
2191 },
2192 "name": "c",
2193 "spec": "2",
2194 "type": "peer",
2195 },
2196 ],
2197 "isWorkspace": false,
2198 "location": "node_modules/c",
2199 "name": "c",
2200 "version": "2.2.2",
2201 "whileInstalling": Object {
2202 "name": "project",
2203 "path": "/some/path",
2204 "version": "1.2.3",
2205 },
2206 },
2207 },
2208 "strictPeerDeps": false,
2209 }
2210 `
2211
2212 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, force > changes to tree 1`] = `
2213 --- expected
2214 +++ actual
2215 @@ -104,17 +104,11 @@
2216 "spec": "1",
2217 "from": "node_modules/bb",
2218 },
2219 - EdgeIn {
2220 - "type": "peer",
2221 - "name": "c",
2222 - "spec": "1",
2223 - "from": "node_modules/d",
2224 - },
2225 },
2226 },
2227 "d" => ArboristNode {
2228 "name": "d",
2229 - "version": "1.1.1",
2230 + "version": "1.2.2",
2231 "location": "node_modules/d",
2232 "path": "/some/path/node_modules/d",
2233 "extraneous": true,
2234 @@ -122,11 +116,12 @@
2235 "optional": true,
2236 "peer": true,
2237 "edgesOut": Map {
2238 - "c" => EdgeOut {
2239 + "b" => EdgeOut {
2240 "type": "peer",
2241 - "name": "c",
2242 - "spec": "1",
2243 - "to": "node_modules/c",
2244 + "name": "b",
2245 + "spec": "2",
2246 + "error": "MISSING",
2247 + "to": null,
2248 },
2249 },
2250 "edgesIn": Set {
2251
2252 `
2253
2254 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, force > placements 1`] = `
2255 Array [
2256 Object {
2257 "canPlace": Symbol(REPLACE),
2258 "canPlaceSelf": Symbol(REPLACE),
2259 "checks": Map {
2260 "" => Array [
2261 Symbol(REPLACE),
2262 Symbol(REPLACE),
2263 ],
2264 },
2265 "dep": "[email protected]",
2266 "edge": "{ ROOT prod [email protected] }",
2267 "placed": "node_modules/d",
2268 },
2269 ]
2270 `
2271
2272 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, force > warnings 1`] = `
2273 Array []
2274 `
2275
2276 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, legacyPeerDeps > changes to tree 1`] = `
2277 --- expected
2278 +++ actual
2279 @@ -123,15 +123,6 @@
2280 "from": "",
2281 },
2282 },
2283 - "edgesOut": Map {
2284 - "b" => EdgeOut {
2285 - "type": "peer",
2286 - "name": "b",
2287 - "spec": "2",
2288 - "error": "MISSING",
2289 - "to": null,
2290 - },
2291 - },
2292 },
2293 },
2294 }
2295
2296 `
2297
2298 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, legacyPeerDeps > placements 1`] = `
2299 Array [
2300 Object {
2301 "canPlace": Symbol(REPLACE),
2302 "canPlaceSelf": Symbol(REPLACE),
2303 "checks": Map {
2304 "" => Array [
2305 Symbol(REPLACE),
2306 Symbol(REPLACE),
2307 ],
2308 },
2309 "dep": "[email protected]",
2310 "edge": "{ ROOT prod [email protected] }",
2311 "placed": "node_modules/d",
2312 },
2313 ]
2314 `
2315
2316 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, conflict on peer xyz, legacyPeerDeps > warnings 1`] = `
2317 Array []
2318 `
2319
2320 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, force > changes to tree 1`] = `
2321 --- expected
2322 +++ actual
2323 @@ -39,6 +39,7 @@
2324 "name": "b",
2325 "spec": "1",
2326 "error": "INVALID",
2327 + "peerConflicted": true,
2328 "to": "node_modules/b",
2329 },
2330 },
2331 @@ -72,15 +73,16 @@
2332 EdgeIn {
2333 "type": "peer",
2334 "name": "b",
2335 - "spec": "2",
2336 - "from": "node_modules/d",
2337 + "spec": "1",
2338 + "error": "INVALID",
2339 + "peerConflicted": true,
2340 + "from": "node_modules/a",
2341 },
2342 EdgeIn {
2343 "type": "peer",
2344 "name": "b",
2345 - "spec": "1",
2346 - "error": "INVALID",
2347 - "from": "node_modules/a",
2348 + "spec": "2",
2349 + "from": "node_modules/d",
2350 },
2351 },
2352 },
2353
2354 `
2355
2356 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, force > placements 1`] = `
2357 Array [
2358 Object {
2359 "canPlace": null,
2360 "canPlaceSelf": null,
2361 "checks": Map {
2362 "" => Array [
2363 Symbol(CONFLICT),
2364 Symbol(CONFLICT),
2365 ],
2366 },
2367 "dep": "[email protected]",
2368 "edge": "{ node_modules/a peer b@1 }",
2369 "placed": null,
2370 },
2371 ]
2372 `
2373
2374 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, force > warnings 1`] = `
2375 Array [
2376 Array [
2377 "ERESOLVE",
2378 "overriding peer dependency",
2379 Object {
2380 "code": "ERESOLVE",
2381 "current": Object {
2382 "dependents": Array [
2383 Object {
2384 "from": Object {
2385 "dependents": Array [
2386 Object {
2387 "from": Object {
2388 "location": "/some/path",
2389 },
2390 "name": "d",
2391 "spec": "2.x",
2392 "type": "prod",
2393 },
2394 ],
2395 "isWorkspace": false,
2396 "location": "node_modules/d",
2397 "name": "d",
2398 "version": "2.2.2",
2399 },
2400 "name": "b",
2401 "spec": "2",
2402 "type": "peer",
2403 },
2404 ],
2405 "isWorkspace": false,
2406 "location": "node_modules/b",
2407 "name": "b",
2408 "version": "2.2.2",
2409 },
2410 "dep": Object {
2411 "dependents": Array [
2412 Object {
2413 "error": "INVALID",
2414 "from": Object {
2415 "dependents": Array [
2416 Object {
2417 "from": Object {
2418 "location": "/some/path",
2419 },
2420 "name": "a",
2421 "spec": "1.x",
2422 "type": "prod",
2423 },
2424 ],
2425 "isWorkspace": false,
2426 "location": "node_modules/a",
2427 "name": "a",
2428 "version": "1.0.1",
2429 },
2430 "name": "b",
2431 "spec": "1",
2432 "type": "peer",
2433 },
2434 ],
2435 "isWorkspace": false,
2436 "location": "node_modules/b",
2437 "name": "b",
2438 "version": "1.0.1",
2439 "whileInstalling": Object {
2440 "name": "a",
2441 "path": "/some/path/node_modules/a",
2442 "version": "1.0.1",
2443 },
2444 },
2445 "edge": Object {
2446 "error": "INVALID",
2447 "from": Object {
2448 "dependents": Array [
2449 Object {
2450 "from": Object {
2451 "location": "/some/path",
2452 },
2453 "name": "a",
2454 "spec": "1.x",
2455 "type": "prod",
2456 },
2457 ],
2458 "isWorkspace": false,
2459 "location": "node_modules/a",
2460 "name": "a",
2461 "version": "1.0.1",
2462 },
2463 "name": "b",
2464 "spec": "1",
2465 "type": "peer",
2466 },
2467 "force": true,
2468 "isMine": true,
2469 "peerConflict": Object {
2470 "current": Object {
2471 "dependents": Array [
2472 Object {
2473 "from": Object {
2474 "dependents": Array [
2475 Object {
2476 "from": Object {
2477 "location": "/some/path",
2478 },
2479 "name": "d",
2480 "spec": "2.x",
2481 "type": "prod",
2482 },
2483 ],
2484 "isWorkspace": false,
2485 "location": "node_modules/d",
2486 "name": "d",
2487 "version": "2.2.2",
2488 },
2489 "name": "b",
2490 "spec": "2",
2491 "type": "peer",
2492 },
2493 ],
2494 "isWorkspace": false,
2495 "location": "node_modules/b",
2496 "name": "b",
2497 "version": "2.2.2",
2498 },
2499 "peer": Object {
2500 "dependents": Array [
2501 Object {
2502 "error": "INVALID",
2503 "from": Object {
2504 "dependents": Array [
2505 Object {
2506 "from": Object {
2507 "location": "/some/path",
2508 },
2509 "name": "a",
2510 "spec": "1.x",
2511 "type": "prod",
2512 },
2513 ],
2514 "isWorkspace": false,
2515 "location": "node_modules/a",
2516 "name": "a",
2517 "version": "1.0.1",
2518 },
2519 "name": "b",
2520 "spec": "1",
2521 "type": "peer",
2522 },
2523 ],
2524 "isWorkspace": false,
2525 "location": "node_modules/b",
2526 "name": "b",
2527 "version": "1.0.1",
2528 "whileInstalling": Object {
2529 "name": "a",
2530 "path": "/some/path/node_modules/a",
2531 "version": "1.0.1",
2532 },
2533 },
2534 },
2535 "strictPeerDeps": false,
2536 },
2537 ],
2538 ]
2539 `
2540
2541 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, replacement satisfies > changes to tree 1`] = `
2542 --- expected
2543 +++ actual
2544 @@ -56,6 +56,32 @@
2545 },
2546 },
2547 },
2548 + "b" => ArboristNode {
2549 + "name": "b",
2550 + "version": "2.2.2",
2551 + "location": "node_modules/b",
2552 + "path": "/some/path/node_modules/b",
2553 + "extraneous": true,
2554 + "dev": true,
2555 + "optional": true,
2556 + "peer": true,
2557 + "edgesOut": Map {
2558 + "c" => EdgeOut {
2559 + "type": "peer",
2560 + "name": "c",
2561 + "spec": "1",
2562 + "to": "node_modules/c",
2563 + },
2564 + },
2565 + "edgesIn": Set {
2566 + EdgeIn {
2567 + "type": "peer",
2568 + "name": "b",
2569 + "spec": "2",
2570 + "from": "node_modules/d",
2571 + },
2572 + },
2573 + },
2574 "bb" => ArboristNode {
2575 "name": "bb",
2576 "version": "1.0.1",
2577 @@ -107,6 +133,12 @@
2578 EdgeIn {
2579 "type": "peer",
2580 "name": "c",
2581 + "spec": "1",
2582 + "from": "node_modules/b",
2583 + },
2584 + EdgeIn {
2585 + "type": "peer",
2586 + "name": "c",
2587 "spec": "*",
2588 "from": "node_modules/bb",
2589 },
2590 @@ -122,12 +154,6 @@
2591 "spec": "1",
2592 "from": "node_modules/dd",
2593 },
2594 - EdgeIn {
2595 - "type": "peer",
2596 - "name": "c",
2597 - "spec": "1",
2598 - "from": "node_modules/d",
2599 - },
2600 },
2601 },
2602 "cc" => ArboristNode {
2603 @@ -164,7 +190,7 @@
2604 },
2605 "d" => ArboristNode {
2606 "name": "d",
2607 - "version": "1.1.1",
2608 + "version": "1.2.2",
2609 "location": "node_modules/d",
2610 "path": "/some/path/node_modules/d",
2611 "extraneous": true,
2612 @@ -172,11 +198,11 @@
2613 "optional": true,
2614 "peer": true,
2615 "edgesOut": Map {
2616 - "c" => EdgeOut {
2617 + "b" => EdgeOut {
2618 "type": "peer",
2619 - "name": "c",
2620 - "spec": "1",
2621 - "to": "node_modules/c",
2622 + "name": "b",
2623 + "spec": "2",
2624 + "to": "node_modules/b",
2625 },
2626 },
2627 "edgesIn": Set {
2628
2629 `
2630
2631 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, replacement satisfies > placements 1`] = `
2632 Array [
2633 Object {
2634 "canPlace": Symbol(REPLACE),
2635 "canPlaceSelf": Symbol(REPLACE),
2636 "checks": Map {
2637 "" => Array [
2638 Symbol(REPLACE),
2639 Symbol(REPLACE),
2640 ],
2641 },
2642 "dep": "[email protected]",
2643 "edge": "{ ROOT prod [email protected] }",
2644 "placed": "node_modules/d",
2645 },
2646 Object {
2647 "canPlace": Symbol(OK),
2648 "canPlaceSelf": Symbol(OK),
2649 "checks": Map {
2650 "" => Array [
2651 Symbol(REPLACE),
2652 Symbol(REPLACE),
2653 ],
2654 },
2655 "dep": "[email protected]",
2656 "edge": "{ node_modules/d peer b@2 }",
2657 "parent": "d",
2658 "placed": "node_modules/b",
2659 },
2660 ]
2661 `
2662
2663 exports[`test/place-dep.js TAP placement tests existing peer set cannot be pushed deeper, neither can new set, replacement satisfies > warnings 1`] = `
2664 Array []
2665 `
2666
2667 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, conflict on peer > changes to tree 1`] = `
2668 --- expected
2669 +++ actual
2670 @@ -38,7 +38,8 @@
2671 "type": "prod",
2672 "name": "bb",
2673 "spec": "1",
2674 - "to": "node_modules/bb",
2675 + "error": "MISSING",
2676 + "to": null,
2677 },
2678 },
2679 "edgesIn": Set {
2680 @@ -50,9 +51,35 @@
2681 },
2682 },
2683 },
2684 + "b" => ArboristNode {
2685 + "name": "b",
2686 + "version": "2.2.2",
2687 + "location": "node_modules/b",
2688 + "path": "/some/path/node_modules/b",
2689 + "extraneous": true,
2690 + "dev": true,
2691 + "optional": true,
2692 + "peer": true,
2693 + "edgesOut": Map {
2694 + "c" => EdgeOut {
2695 + "type": "peer",
2696 + "name": "c",
2697 + "spec": "2",
2698 + "to": "node_modules/c",
2699 + },
2700 + },
2701 + "edgesIn": Set {
2702 + EdgeIn {
2703 + "type": "peer",
2704 + "name": "b",
2705 + "spec": "2",
2706 + "from": "node_modules/d",
2707 + },
2708 + },
2709 + },
2710 "c" => ArboristNode {
2711 "name": "c",
2712 - "version": "1.0.1",
2713 + "version": "2.2.2",
2714 "location": "node_modules/c",
2715 "path": "/some/path/node_modules/c",
2716 "extraneous": true,
2717 @@ -63,20 +90,14 @@
2718 EdgeIn {
2719 "type": "peer",
2720 "name": "c",
2721 - "spec": "1",
2722 - "from": "node_modules/bb",
2723 + "spec": "2",
2724 + "from": "node_modules/b",
2725 },
2726 - EdgeIn {
2727 - "type": "peer",
2728 - "name": "c",
2729 - "spec": "1",
2730 - "from": "node_modules/d",
2731 - },
2732 },
2733 },
2734 "d" => ArboristNode {
2735 "name": "d",
2736 - "version": "1.1.1",
2737 + "version": "1.2.2",
2738 "location": "node_modules/d",
2739 "path": "/some/path/node_modules/d",
2740 "extraneous": true,
2741 @@ -84,11 +105,11 @@
2742 "optional": true,
2743 "peer": true,
2744 "edgesOut": Map {
2745 - "c" => EdgeOut {
2746 + "b" => EdgeOut {
2747 "type": "peer",
2748 - "name": "c",
2749 - "spec": "1",
2750 - "to": "node_modules/c",
2751 + "name": "b",
2752 + "spec": "2",
2753 + "to": "node_modules/b",
2754 },
2755 },
2756 "edgesIn": Set {
2757 @@ -100,31 +121,5 @@
2758 },
2759 },
2760 },
2761 - "bb" => ArboristNode {
2762 - "name": "bb",
2763 - "version": "1.0.1",
2764 - "location": "node_modules/bb",
2765 - "path": "/some/path/node_modules/bb",
2766 - "extraneous": true,
2767 - "dev": true,
2768 - "optional": true,
2769 - "peer": true,
2770 - "edgesOut": Map {
2771 - "c" => EdgeOut {
2772 - "type": "peer",
2773 - "name": "c",
2774 - "spec": "1",
2775 - "to": "node_modules/c",
2776 - },
2777 - },
2778 - "edgesIn": Set {
2779 - EdgeIn {
2780 - "type": "prod",
2781 - "name": "bb",
2782 - "spec": "1",
2783 - "from": "node_modules/a",
2784 - },
2785 - },
2786 - },
2787 },
2788 }
2789
2790 `
2791
2792 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, conflict on peer > placements 1`] = `
2793 Array [
2794 Object {
2795 "canPlace": Symbol(REPLACE),
2796 "canPlaceSelf": Symbol(REPLACE),
2797 "checks": Map {
2798 "" => Array [
2799 Symbol(REPLACE),
2800 Symbol(REPLACE),
2801 ],
2802 },
2803 "dep": "[email protected]",
2804 "edge": "{ ROOT prod [email protected] }",
2805 "placed": "node_modules/d",
2806 },
2807 Object {
2808 "canPlace": Symbol(OK),
2809 "canPlaceSelf": Symbol(OK),
2810 "checks": Map {
2811 "" => Array [
2812 Symbol(REPLACE),
2813 Symbol(REPLACE),
2814 ],
2815 },
2816 "dep": "[email protected]",
2817 "edge": "{ node_modules/d peer b@2 }",
2818 "parent": "d",
2819 "placed": "node_modules/b",
2820 },
2821 Object {
2822 "canPlace": Symbol(REPLACE),
2823 "canPlaceSelf": Symbol(REPLACE),
2824 "checks": Map {
2825 "" => Array [
2826 Symbol(REPLACE),
2827 Symbol(REPLACE),
2828 ],
2829 },
2830 "dep": "[email protected]",
2831 "edge": "{ node_modules/b peer c@2 }",
2832 "parent": "b",
2833 "placed": "node_modules/c",
2834 },
2835 ]
2836 `
2837
2838 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, conflict on peer > warnings 1`] = `
2839 Array []
2840 `
2841
2842 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, no current > changes to tree 1`] = `
2843 --- expected
2844 +++ actual
2845 @@ -20,8 +20,7 @@
2846 "type": "prod",
2847 "name": "d",
2848 "spec": "2.x",
2849 - "to": null,
2850 - "error": "MISSING",
2851 + "to": "node_modules/d",
2852 },
2853 },
2854 "children": Map {
2855 @@ -39,6 +38,7 @@
2856 "type": "prod",
2857 "name": "b",
2858 "spec": "1",
2859 + "error": "INVALID",
2860 "to": "node_modules/b",
2861 },
2862 },
2863 @@ -53,7 +53,7 @@
2864 },
2865 "b" => ArboristNode {
2866 "name": "b",
2867 - "version": "1.0.1",
2868 + "version": "2.2.2",
2869 "location": "node_modules/b",
2870 "path": "/some/path/node_modules/b",
2871 "extraneous": true,
2872 @@ -64,7 +64,7 @@
2873 "c" => EdgeOut {
2874 "type": "peer",
2875 "name": "c",
2876 - "spec": "1",
2877 + "spec": "2",
2878 "to": "node_modules/c",
2879 },
2880 },
2881 @@ -73,13 +73,20 @@
2882 "type": "prod",
2883 "name": "b",
2884 "spec": "1",
2885 + "error": "INVALID",
2886 "from": "node_modules/a",
2887 },
2888 + EdgeIn {
2889 + "type": "peer",
2890 + "name": "b",
2891 + "spec": "2",
2892 + "from": "node_modules/d",
2893 + },
2894 },
2895 },
2896 "c" => ArboristNode {
2897 "name": "c",
2898 - "version": "1.0.1",
2899 + "version": "2.2.2",
2900 "location": "node_modules/c",
2901 "path": "/some/path/node_modules/c",
2902 "extraneous": true,
2903 @@ -90,10 +97,36 @@
2904 EdgeIn {
2905 "type": "peer",
2906 "name": "c",
2907 - "spec": "1",
2908 + "spec": "2",
2909 "from": "node_modules/b",
2910 },
2911 },
2912 },
2913 + "d" => ArboristNode {
2914 + "name": "d",
2915 + "version": "2.2.2",
2916 + "location": "node_modules/d",
2917 + "path": "/some/path/node_modules/d",
2918 + "extraneous": true,
2919 + "dev": true,
2920 + "optional": true,
2921 + "peer": true,
2922 + "edgesOut": Map {
2923 + "b" => EdgeOut {
2924 + "type": "peer",
2925 + "name": "b",
2926 + "spec": "2",
2927 + "to": "node_modules/b",
2928 + },
2929 + },
2930 + "edgesIn": Set {
2931 + EdgeIn {
2932 + "type": "prod",
2933 + "name": "d",
2934 + "spec": "2.x",
2935 + "from": "",
2936 + },
2937 + },
2938 + },
2939 },
2940 }
2941
2942 `
2943
2944 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, no current > placements 1`] = `
2945 Array [
2946 Object {
2947 "canPlace": Symbol(OK),
2948 "canPlaceSelf": Symbol(OK),
2949 "checks": Map {
2950 "" => Array [
2951 Symbol(OK),
2952 Symbol(OK),
2953 ],
2954 },
2955 "dep": "[email protected]",
2956 "edge": "{ ROOT prod [email protected] }",
2957 "placed": "node_modules/d",
2958 },
2959 Object {
2960 "canPlace": Symbol(REPLACE),
2961 "canPlaceSelf": Symbol(REPLACE),
2962 "checks": Map {
2963 "" => Array [
2964 Symbol(OK),
2965 Symbol(OK),
2966 ],
2967 },
2968 "dep": "[email protected]",
2969 "edge": "{ node_modules/d peer b@2 }",
2970 "parent": "d",
2971 "placed": "node_modules/b",
2972 },
2973 Object {
2974 "canPlace": Symbol(OK),
2975 "canPlaceSelf": Symbol(OK),
2976 "checks": Map {
2977 "" => Array [
2978 Symbol(OK),
2979 Symbol(OK),
2980 ],
2981 },
2982 "dep": "[email protected]",
2983 "edge": "{ node_modules/b peer c@2 }",
2984 "parent": "b",
2985 "placed": "node_modules/c",
2986 },
2987 ]
2988 `
2989
2990 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, no current > warnings 1`] = `
2991 Array []
2992 `
2993
2994 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with invalid current > changes to tree 1`] = `
2995 --- expected
2996 +++ actual
2997 @@ -21,7 +21,6 @@
2998 "name": "d",
2999 "spec": "2.x",
3000 "to": "node_modules/d",
3001 - "error": "INVALID",
3002 },
3003 },
3004 "children": Map {
3005 @@ -39,6 +38,7 @@
3006 "type": "prod",
3007 "name": "b",
3008 "spec": "1",
3009 + "error": "INVALID",
3010 "to": "node_modules/b",
3011 },
3012 },
3013 @@ -53,7 +53,7 @@
3014 },
3015 "b" => ArboristNode {
3016 "name": "b",
3017 - "version": "1.0.1",
3018 + "version": "2.2.2",
3019 "location": "node_modules/b",
3020 "path": "/some/path/node_modules/b",
3021 "extraneous": true,
3022 @@ -64,7 +64,7 @@
3023 "c" => EdgeOut {
3024 "type": "peer",
3025 "name": "c",
3026 - "spec": "1",
3027 + "spec": "2",
3028 "to": "node_modules/c",
3029 },
3030 },
3031 @@ -73,19 +73,20 @@
3032 "type": "prod",
3033 "name": "b",
3034 "spec": "1",
3035 + "error": "INVALID",
3036 "from": "node_modules/a",
3037 },
3038 EdgeIn {
3039 "type": "peer",
3040 "name": "b",
3041 - "spec": "1",
3042 + "spec": "2",
3043 "from": "node_modules/d",
3044 },
3045 },
3046 },
3047 "c" => ArboristNode {
3048 "name": "c",
3049 - "version": "1.0.1",
3050 + "version": "2.2.2",
3051 "location": "node_modules/c",
3052 "path": "/some/path/node_modules/c",
3053 "extraneous": true,
3054 @@ -96,14 +97,14 @@
3055 EdgeIn {
3056 "type": "peer",
3057 "name": "c",
3058 - "spec": "1",
3059 + "spec": "2",
3060 "from": "node_modules/b",
3061 },
3062 },
3063 },
3064 "d" => ArboristNode {
3065 "name": "d",
3066 - "version": "1.1.1",
3067 + "version": "2.2.2",
3068 "location": "node_modules/d",
3069 "path": "/some/path/node_modules/d",
3070 "extraneous": true,
3071 @@ -114,7 +115,7 @@
3072 "b" => EdgeOut {
3073 "type": "peer",
3074 "name": "b",
3075 - "spec": "1",
3076 + "spec": "2",
3077 "to": "node_modules/b",
3078 },
3079 },
3080 @@ -123,7 +124,6 @@
3081 "type": "prod",
3082 "name": "d",
3083 "spec": "2.x",
3084 - "error": "INVALID",
3085 "from": "",
3086 },
3087 },
3088
3089 `
3090
3091 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with invalid current > placements 1`] = `
3092 Array [
3093 Object {
3094 "canPlace": Symbol(REPLACE),
3095 "canPlaceSelf": Symbol(REPLACE),
3096 "checks": Map {
3097 "" => Array [
3098 Symbol(REPLACE),
3099 Symbol(REPLACE),
3100 ],
3101 },
3102 "dep": "[email protected]",
3103 "edge": "{ ROOT prod [email protected] }",
3104 "placed": "node_modules/d",
3105 },
3106 Object {
3107 "canPlace": Symbol(REPLACE),
3108 "canPlaceSelf": Symbol(REPLACE),
3109 "checks": Map {
3110 "" => Array [
3111 Symbol(REPLACE),
3112 Symbol(REPLACE),
3113 ],
3114 },
3115 "dep": "[email protected]",
3116 "edge": "{ node_modules/d peer b@2 }",
3117 "parent": "d",
3118 "placed": "node_modules/b",
3119 },
3120 Object {
3121 "canPlace": Symbol(OK),
3122 "canPlaceSelf": Symbol(OK),
3123 "checks": Map {
3124 "" => Array [
3125 Symbol(REPLACE),
3126 Symbol(REPLACE),
3127 ],
3128 },
3129 "dep": "[email protected]",
3130 "edge": "{ node_modules/b peer c@2 }",
3131 "parent": "b",
3132 "placed": "node_modules/c",
3133 },
3134 ]
3135 `
3136
3137 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with invalid current > warnings 1`] = `
3138 Array []
3139 `
3140
3141 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with valid current > changes to tree 1`] = `
3142 --- expected
3143 +++ actual
3144 @@ -38,6 +38,7 @@
3145 "type": "prod",
3146 "name": "b",
3147 "spec": "1",
3148 + "error": "INVALID",
3149 "to": "node_modules/b",
3150 },
3151 },
3152 @@ -52,7 +53,7 @@
3153 },
3154 "b" => ArboristNode {
3155 "name": "b",
3156 - "version": "1.0.1",
3157 + "version": "2.2.2",
3158 "location": "node_modules/b",
3159 "path": "/some/path/node_modules/b",
3160 "extraneous": true,
3161 @@ -63,7 +64,7 @@
3162 "c" => EdgeOut {
3163 "type": "peer",
3164 "name": "c",
3165 - "spec": "1",
3166 + "spec": "2",
3167 "to": "node_modules/c",
3168 },
3169 },
3170 @@ -72,19 +73,20 @@
3171 "type": "prod",
3172 "name": "b",
3173 "spec": "1",
3174 + "error": "INVALID",
3175 "from": "node_modules/a",
3176 },
3177 EdgeIn {
3178 "type": "peer",
3179 "name": "b",
3180 - "spec": "1",
3181 + "spec": "2",
3182 "from": "node_modules/d",
3183 },
3184 },
3185 },
3186 "c" => ArboristNode {
3187 "name": "c",
3188 - "version": "1.0.1",
3189 + "version": "2.2.2",
3190 "location": "node_modules/c",
3191 "path": "/some/path/node_modules/c",
3192 "extraneous": true,
3193 @@ -95,14 +97,14 @@
3194 EdgeIn {
3195 "type": "peer",
3196 "name": "c",
3197 - "spec": "1",
3198 + "spec": "2",
3199 "from": "node_modules/b",
3200 },
3201 },
3202 },
3203 "d" => ArboristNode {
3204 "name": "d",
3205 - "version": "1.1.1",
3206 + "version": "1.2.2",
3207 "location": "node_modules/d",
3208 "path": "/some/path/node_modules/d",
3209 "extraneous": true,
3210 @@ -113,7 +115,7 @@
3211 "b" => EdgeOut {
3212 "type": "peer",
3213 "name": "b",
3214 - "spec": "1",
3215 + "spec": "2",
3216 "to": "node_modules/b",
3217 },
3218 },
3219
3220 `
3221
3222 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with valid current > placements 1`] = `
3223 Array [
3224 Object {
3225 "canPlace": Symbol(REPLACE),
3226 "canPlaceSelf": Symbol(REPLACE),
3227 "checks": Map {
3228 "" => Array [
3229 Symbol(REPLACE),
3230 Symbol(REPLACE),
3231 ],
3232 },
3233 "dep": "[email protected]",
3234 "edge": "{ ROOT prod [email protected] }",
3235 "placed": "node_modules/d",
3236 },
3237 Object {
3238 "canPlace": Symbol(REPLACE),
3239 "canPlaceSelf": Symbol(REPLACE),
3240 "checks": Map {
3241 "" => Array [
3242 Symbol(REPLACE),
3243 Symbol(REPLACE),
3244 ],
3245 },
3246 "dep": "[email protected]",
3247 "edge": "{ node_modules/d peer b@2 }",
3248 "parent": "d",
3249 "placed": "node_modules/b",
3250 },
3251 Object {
3252 "canPlace": Symbol(OK),
3253 "canPlaceSelf": Symbol(OK),
3254 "checks": Map {
3255 "" => Array [
3256 Symbol(REPLACE),
3257 Symbol(REPLACE),
3258 ],
3259 },
3260 "dep": "[email protected]",
3261 "edge": "{ node_modules/b peer c@2 }",
3262 "parent": "b",
3263 "placed": "node_modules/c",
3264 },
3265 ]
3266 `
3267
3268 exports[`test/place-dep.js TAP placement tests existing peer set which can be pushed deeper, with valid current > warnings 1`] = `
3269 Array []
3270 `
3271
3272 exports[`test/place-dep.js TAP placement tests explicit placement of a production dep > changes to tree 1`] = `
3273 --- expected
3274 +++ actual
3275 @@ -12,8 +12,27 @@
3276 "type": "prod",
3277 "name": "foo",
3278 "spec": "1",
3279 - "to": null,
3280 - "error": "MISSING",
3281 + "to": "node_modules/foo",
3282 },
3283 },
3284 + "children": Map {
3285 + "foo" => ArboristNode {
3286 + "name": "foo",
3287 + "version": "1.0.0",
3288 + "location": "node_modules/foo",
3289 + "path": "/some/path/node_modules/foo",
3290 + "extraneous": true,
3291 + "dev": true,
3292 + "optional": true,
3293 + "peer": true,
3294 + "edgesIn": Set {
3295 + EdgeIn {
3296 + "type": "prod",
3297 + "name": "foo",
3298 + "spec": "1",
3299 + "from": "",
3300 + },
3301 + },
3302 + },
3303 + },
3304 }
3305
3306 `
3307
3308 exports[`test/place-dep.js TAP placement tests explicit placement of a production dep > placements 1`] = `
3309 Array [
3310 Object {
3311 "canPlace": Symbol(OK),
3312 "canPlaceSelf": Symbol(OK),
3313 "checks": Map {
3314 "" => Array [
3315 Symbol(OK),
3316 Symbol(OK),
3317 ],
3318 },
3319 "dep": "[email protected]",
3320 "edge": "{ ROOT prod foo@1 }",
3321 "placed": "node_modules/foo",
3322 },
3323 ]
3324 `
3325
3326 exports[`test/place-dep.js TAP placement tests explicit placement of a production dep > warnings 1`] = `
3327 Array []
3328 `
3329
3330 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep > thrown error 1`] = `
3331 Error: could not resolve {
3332 "code": "ERESOLVE",
3333 "current": null,
3334 "dep": Object {
3335 "dependents": Array [
3336 Object {
3337 "error": "MISSING",
3338 "from": Object {
3339 "location": "/some/path",
3340 },
3341 "name": "b",
3342 "spec": "2",
3343 "type": "prod",
3344 },
3345 ],
3346 "isWorkspace": false,
3347 "location": "node_modules/b",
3348 "name": "b",
3349 "version": "2.0.0",
3350 "whileInstalling": Object {
3351 "name": undefined,
3352 "path": "/some/path",
3353 "version": undefined,
3354 },
3355 },
3356 "edge": Object {
3357 "error": "MISSING",
3358 "from": Object {
3359 "location": "/some/path",
3360 },
3361 "name": "b",
3362 "spec": "2",
3363 "type": "prod",
3364 },
3365 "force": false,
3366 "isMine": true,
3367 "name": "Error",
3368 "peerConflict": Object {
3369 "current": Object {
3370 "dependents": Array [
3371 Object {
3372 "from": Object {
3373 "dependents": Array [
3374 Object {
3375 "from": Object {
3376 "dependents": Array [
3377 Object {
3378 "from": Object {
3379 "location": "/some/path",
3380 },
3381 "name": "a",
3382 "spec": "1",
3383 "type": "prod",
3384 },
3385 ],
3386 "isWorkspace": false,
3387 "location": "node_modules/a",
3388 "name": "a",
3389 "version": "1.0.0",
3390 },
3391 "name": "x",
3392 "spec": "1",
3393 "type": "peer",
3394 },
3395 ],
3396 "isWorkspace": false,
3397 "location": "node_modules/x",
3398 "name": "x",
3399 "version": "1.0.0",
3400 },
3401 "name": "y",
3402 "spec": "1",
3403 "type": "peer",
3404 },
3405 ],
3406 "isWorkspace": false,
3407 "location": "node_modules/y",
3408 "name": "y",
3409 "version": "1.0.0",
3410 },
3411 "peer": Object {
3412 "dependents": Array [
3413 Object {
3414 "from": Object {
3415 "dependents": Array [
3416 Object {
3417 "from": Object {
3418 "dependents": Array [
3419 Object {
3420 "error": "MISSING",
3421 "from": Object {
3422 "location": "/some/path",
3423 },
3424 "name": "b",
3425 "spec": "2",
3426 "type": "prod",
3427 },
3428 ],
3429 "isWorkspace": false,
3430 "location": "node_modules/b",
3431 "name": "b",
3432 "version": "2.0.0",
3433 "whileInstalling": Object {
3434 "name": undefined,
3435 "path": "/some/path",
3436 "version": undefined,
3437 },
3438 },
3439 "name": "k",
3440 "spec": "2",
3441 "type": "peer",
3442 },
3443 ],
3444 "isWorkspace": false,
3445 "location": "node_modules/k",
3446 "name": "k",
3447 "version": "2.0.0",
3448 "whileInstalling": Object {
3449 "name": undefined,
3450 "path": "/some/path",
3451 "version": undefined,
3452 },
3453 },
3454 "name": "y",
3455 "spec": "2",
3456 "type": "peer",
3457 },
3458 ],
3459 "isWorkspace": false,
3460 "location": "node_modules/y",
3461 "name": "y",
3462 "version": "2.0.0",
3463 "whileInstalling": Object {
3464 "name": undefined,
3465 "path": "/some/path",
3466 "version": undefined,
3467 },
3468 },
3469 },
3470 "strictPeerDeps": false,
3471 }
3472 `
3473
3474 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, force > changes to tree 1`] = `
3475 --- expected
3476 +++ actual
3477 @@ -18,8 +18,7 @@
3478 "type": "prod",
3479 "name": "b",
3480 "spec": "2",
3481 - "to": null,
3482 - "error": "MISSING",
3483 + "to": "node_modules/b",
3484 },
3485 },
3486 "children": Map {
3487 @@ -49,6 +48,33 @@
3488 },
3489 },
3490 },
3491 + "b" => ArboristNode {
3492 + "name": "b",
3493 + "version": "2.0.0",
3494 + "location": "node_modules/b",
3495 + "path": "/some/path/node_modules/b",
3496 + "extraneous": true,
3497 + "dev": true,
3498 + "optional": true,
3499 + "peer": true,
3500 + "edgesOut": Map {
3501 + "k" => EdgeOut {
3502 + "type": "peer",
3503 + "name": "k",
3504 + "spec": "2",
3505 + "error": "MISSING",
3506 + "to": null,
3507 + },
3508 + },
3509 + "edgesIn": Set {
3510 + EdgeIn {
3511 + "type": "prod",
3512 + "name": "b",
3513 + "spec": "2",
3514 + "from": "",
3515 + },
3516 + },
3517 + },
3518 "x" => ArboristNode {
3519 "name": "x",
3520 "version": "1.0.0",
3521
3522 `
3523
3524 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, force > placements 1`] = `
3525 Array [
3526 Object {
3527 "canPlace": Symbol(OK),
3528 "canPlaceSelf": Symbol(OK),
3529 "checks": Map {
3530 "" => Array [
3531 Symbol(OK),
3532 Symbol(OK),
3533 ],
3534 },
3535 "dep": "[email protected]",
3536 "edge": "{ ROOT prod b@2 }",
3537 "placed": "node_modules/b",
3538 },
3539 ]
3540 `
3541
3542 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, force > warnings 1`] = `
3543 Array []
3544 `
3545
3546 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, legacyPeerDeps > changes to tree 1`] = `
3547 --- expected
3548 +++ actual
3549
3550 `
3551
3552 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, legacyPeerDeps > placements 1`] = `
3553 Array [
3554 Object {
3555 "canPlace": null,
3556 "canPlaceSelf": null,
3557 "checks": Map {},
3558 "dep": "[email protected]",
3559 "edge": "{ ROOT prod b@2 }",
3560 "placed": null,
3561 },
3562 ]
3563 `
3564
3565 exports[`test/place-dep.js TAP placement tests fail with ERESOLVE on deep peer dep, legacyPeerDeps > warnings 1`] = `
3566 Array []
3567 `
3568
3569 exports[`test/place-dep.js TAP placement tests have replacement for conflicted entry node > changes to tree 1`] = `
3570 --- expected
3571 +++ actual
3572 @@ -13,7 +13,6 @@
3573 "name": "a",
3574 "spec": "2",
3575 "to": "node_modules/a",
3576 - "error": "INVALID",
3577 },
3578 "c" => EdgeOut {
3579 "type": "prod",
3580 @@ -25,7 +24,7 @@
3581 "children": Map {
3582 "a" => ArboristNode {
3583 "name": "a",
3584 - "version": "1.0.0",
3585 + "version": "2.0.0",
3586 "location": "node_modules/a",
3587 "path": "/some/path/node_modules/a",
3588 "extraneous": true,
3589 @@ -36,7 +35,7 @@
3590 "b" => EdgeOut {
3591 "type": "peer",
3592 "name": "b",
3593 - "spec": "1",
3594 + "spec": "2",
3595 "to": "node_modules/b",
3596 },
3597 },
3598 @@ -45,14 +44,13 @@
3599 "type": "prod",
3600 "name": "a",
3601 "spec": "2",
3602 - "error": "INVALID",
3603 "from": "",
3604 },
3605 },
3606 },
3607 "b" => ArboristNode {
3608 "name": "b",
3609 - "version": "1.0.0",
3610 + "version": "2.0.0",
3611 "location": "node_modules/b",
3612 "path": "/some/path/node_modules/b",
3613 "extraneous": true,
3614 @@ -63,7 +61,7 @@
3615 "c" => EdgeOut {
3616 "type": "peer",
3617 "name": "c",
3618 - "spec": "1",
3619 + "spec": "2",
3620 "to": "node_modules/c",
3621 },
3622 },
3623 @@ -71,14 +69,14 @@
3624 EdgeIn {
3625 "type": "peer",
3626 "name": "b",
3627 - "spec": "1",
3628 + "spec": "2",
3629 "from": "node_modules/a",
3630 },
3631 },
3632 },
3633 "c" => ArboristNode {
3634 "name": "c",
3635 - "version": "1.0.0",
3636 + "version": "2.0.0",
3637 "location": "node_modules/c",
3638 "path": "/some/path/node_modules/c",
3639 "extraneous": true,
3640 @@ -89,7 +87,7 @@
3641 "d" => EdgeOut {
3642 "type": "peer",
3643 "name": "d",
3644 - "spec": "1",
3645 + "spec": "2",
3646 "to": "node_modules/d",
3647 },
3648 },
3649 @@ -103,14 +101,14 @@
3650 EdgeIn {
3651 "type": "peer",
3652 "name": "c",
3653 - "spec": "1",
3654 + "spec": "2",
3655 "from": "node_modules/b",
3656 },
3657 },
3658 },
3659 "d" => ArboristNode {
3660 "name": "d",
3661 - "version": "1.0.0",
3662 + "version": "2.0.0",
3663 "location": "node_modules/d",
3664 "path": "/some/path/node_modules/d",
3665 "extraneous": true,
3666 @@ -121,7 +119,7 @@
3667 EdgeIn {
3668 "type": "peer",
3669 "name": "d",
3670 - "spec": "1",
3671 + "spec": "2",
3672 "from": "node_modules/c",
3673 },
3674 },
3675
3676 `
3677
3678 exports[`test/place-dep.js TAP placement tests have replacement for conflicted entry node > placements 1`] = `
3679 Array [
3680 Object {
3681 "canPlace": Symbol(REPLACE),
3682 "canPlaceSelf": Symbol(REPLACE),
3683 "checks": Map {
3684 "" => Array [
3685 Symbol(REPLACE),
3686 Symbol(REPLACE),
3687 ],
3688 },
3689 "dep": "[email protected]",
3690 "edge": "{ ROOT prod a@2 }",
3691 "placed": "node_modules/a",
3692 },
3693 Object {
3694 "canPlace": Symbol(OK),
3695 "canPlaceSelf": Symbol(OK),
3696 "checks": Map {
3697 "" => Array [
3698 Symbol(REPLACE),
3699 Symbol(REPLACE),
3700 ],
3701 },
3702 "dep": "[email protected]",
3703 "edge": "{ node_modules/a peer b@2 }",
3704 "parent": "a",
3705 "placed": "node_modules/b",
3706 },
3707 Object {
3708 "canPlace": Symbol(REPLACE),
3709 "canPlaceSelf": Symbol(REPLACE),
3710 "checks": Map {
3711 "" => Array [
3712 Symbol(REPLACE),
3713 Symbol(REPLACE),
3714 ],
3715 },
3716 "dep": "[email protected]",
3717 "edge": "{ node_modules/b peer c@2 }",
3718 "parent": "b",
3719 "placed": "node_modules/c",
3720 },
3721 Object {
3722 "canPlace": Symbol(OK),
3723 "canPlaceSelf": Symbol(OK),
3724 "checks": Map {
3725 "" => Array [
3726 Symbol(REPLACE),
3727 Symbol(REPLACE),
3728 ],
3729 },
3730 "dep": "[email protected]",
3731 "edge": "{ node_modules/c peer d@2 }",
3732 "parent": "c",
3733 "placed": "node_modules/d",
3734 },
3735 ]
3736 `
3737
3738 exports[`test/place-dep.js TAP placement tests have replacement for conflicted entry node > warnings 1`] = `
3739 Array []
3740 `
3741
3742 exports[`test/place-dep.js TAP placement tests keep, but dedupe > changes to tree 1`] = `
3743 --- expected
3744 +++ actual
3745 @@ -43,29 +43,9 @@
3746 "type": "prod",
3747 "name": "y",
3748 "spec": "1",
3749 - "to": "z/node_modules/y",
3750 + "to": "node_modules/y",
3751 },
3752 },
3753 - "children": Map {
3754 - "y" => ArboristNode {
3755 - "name": "y",
3756 - "version": "1.1.2",
3757 - "location": "z/node_modules/y",
3758 - "path": "/some/path/z/node_modules/y",
3759 - "extraneous": true,
3760 - "dev": true,
3761 - "optional": true,
3762 - "peer": true,
3763 - "edgesIn": Set {
3764 - EdgeIn {
3765 - "type": "prod",
3766 - "name": "y",
3767 - "spec": "1",
3768 - "from": "z",
3769 - },
3770 - },
3771 - },
3772 - },
3773 },
3774 },
3775 "children": Map {
3776 @@ -83,7 +63,7 @@
3777 "type": "prod",
3778 "name": "y",
3779 "spec": "1.1",
3780 - "to": "node_modules/x/node_modules/y",
3781 + "to": "node_modules/y",
3782 },
3783 },
3784 "edgesIn": Set {
3785 @@ -94,26 +74,6 @@
3786 "from": "",
3787 },
3788 },
3789 - "children": Map {
3790 - "y" => ArboristNode {
3791 - "name": "y",
3792 - "version": "1.1.0",
3793 - "location": "node_modules/x/node_modules/y",
3794 - "path": "/some/path/node_modules/x/node_modules/y",
3795 - "extraneous": true,
3796 - "dev": true,
3797 - "optional": true,
3798 - "peer": true,
3799 - "edgesIn": Set {
3800 - EdgeIn {
3801 - "type": "prod",
3802 - "name": "y",
3803 - "spec": "1.1",
3804 - "from": "node_modules/x",
3805 - },
3806 - },
3807 - },
3808 - },
3809 },
3810 "y" => ArboristNode {
3811 "name": "y",
3812 @@ -131,6 +91,18 @@
3813 "spec": "1",
3814 "from": "",
3815 },
3816 + EdgeIn {
3817 + "type": "prod",
3818 + "name": "y",
3819 + "spec": "1.1",
3820 + "from": "node_modules/x",
3821 + },
3822 + EdgeIn {
3823 + "type": "prod",
3824 + "name": "y",
3825 + "spec": "1",
3826 + "from": "z",
3827 + },
3828 },
3829 },
3830 },
3831
3832 `
3833
3834 exports[`test/place-dep.js TAP placement tests keep, but dedupe > placements 1`] = `
3835 Array [
3836 Object {
3837 "canPlace": Symbol(KEEP),
3838 "canPlaceSelf": Symbol(KEEP),
3839 "checks": Map {
3840 "node_modules/x" => Array [
3841 Symbol(REPLACE),
3842 Symbol(REPLACE),
3843 ],
3844 "" => Array [
3845 Symbol(KEEP),
3846 Symbol(KEEP),
3847 ],
3848 },
3849 "dep": "[email protected]",
3850 "edge": "{ node_modules/x prod [email protected] }",
3851 "placed": null,
3852 },
3853 ]
3854 `
3855
3856 exports[`test/place-dep.js TAP placement tests keep, but dedupe > warnings 1`] = `
3857 Array []
3858 `
3859
3860 exports[`test/place-dep.js TAP placement tests nest a transitive dependency > changes to tree 1`] = `
3861 --- expected
3862 +++ actual
3863 @@ -38,13 +38,6 @@
3864 "spec": "1",
3865 "from": "node_modules/foo",
3866 },
3867 - EdgeIn {
3868 - "type": "prod",
3869 - "name": "bar",
3870 - "spec": "1.0.0",
3871 - "error": "INVALID",
3872 - "from": "node_modules/baz",
3873 - },
3874 },
3875 },
3876 "baz" => ArboristNode {
3877 @@ -61,8 +54,7 @@
3878 "type": "prod",
3879 "name": "bar",
3880 "spec": "1.0.0",
3881 - "to": "node_modules/bar",
3882 - "error": "INVALID",
3883 + "to": "node_modules/baz/node_modules/bar",
3884 },
3885 },
3886 "edgesIn": Set {
3887 @@ -73,6 +65,26 @@
3888 "from": "",
3889 },
3890 },
3891 + "children": Map {
3892 + "bar" => ArboristNode {
3893 + "name": "bar",
3894 + "version": "1.0.0",
3895 + "location": "node_modules/baz/node_modules/bar",
3896 + "path": "/some/path/node_modules/baz/node_modules/bar",
3897 + "extraneous": true,
3898 + "dev": true,
3899 + "optional": true,
3900 + "peer": true,
3901 + "edgesIn": Set {
3902 + EdgeIn {
3903 + "type": "prod",
3904 + "name": "bar",
3905 + "spec": "1.0.0",
3906 + "from": "node_modules/baz",
3907 + },
3908 + },
3909 + },
3910 + },
3911 },
3912 "foo" => ArboristNode {
3913 "name": "foo",
3914
3915 `
3916
3917 exports[`test/place-dep.js TAP placement tests nest a transitive dependency > placements 1`] = `
3918 Array [
3919 Object {
3920 "canPlace": Symbol(OK),
3921 "canPlaceSelf": Symbol(OK),
3922 "checks": Map {
3923 "node_modules/baz" => Array [
3924 Symbol(OK),
3925 Symbol(OK),
3926 ],
3927 "" => Array [
3928 Symbol(CONFLICT),
3929 Symbol(CONFLICT),
3930 ],
3931 },
3932 "dep": "[email protected]",
3933 "edge": "{ node_modules/baz prod [email protected] }",
3934 "placed": "node_modules/baz/node_modules/bar",
3935 },
3936 ]
3937 `
3938
3939 exports[`test/place-dep.js TAP placement tests nest a transitive dependency > warnings 1`] = `
3940 Array []
3941 `
3942
3943 exports[`test/place-dep.js TAP placement tests nest because globalStyle > changes to tree 1`] = `
3944 --- expected
3945 +++ actual
3946 @@ -37,8 +37,7 @@
3947 "type": "prod",
3948 "name": "bar",
3949 "spec": "1",
3950 - "to": null,
3951 - "error": "MISSING",
3952 + "to": "node_modules/foo/node_modules/bar",
3953 },
3954 },
3955 "edgesIn": Set {
3956 @@ -49,6 +48,26 @@
3957 "from": "",
3958 },
3959 },
3960 + "children": Map {
3961 + "bar" => ArboristNode {
3962 + "name": "bar",
3963 + "version": "1.0.0",
3964 + "location": "node_modules/foo/node_modules/bar",
3965 + "path": "/some/path/node_modules/foo/node_modules/bar",
3966 + "extraneous": true,
3967 + "dev": true,
3968 + "optional": true,
3969 + "peer": true,
3970 + "edgesIn": Set {
3971 + EdgeIn {
3972 + "type": "prod",
3973 + "name": "bar",
3974 + "spec": "1",
3975 + "from": "node_modules/foo",
3976 + },
3977 + },
3978 + },
3979 + },
3980 },
3981 },
3982 }
3983
3984 `
3985
3986 exports[`test/place-dep.js TAP placement tests nest because globalStyle > placements 1`] = `
3987 Array [
3988 Object {
3989 "canPlace": Symbol(OK),
3990 "canPlaceSelf": Symbol(OK),
3991 "checks": Map {
3992 "node_modules/foo" => Array [
3993 Symbol(OK),
3994 Symbol(OK),
3995 ],
3996 },
3997 "dep": "[email protected]",
3998 "edge": "{ node_modules/foo prod bar@1 }",
3999 "placed": "node_modules/foo/node_modules/bar",
4000 },
4001 ]
4002 `
4003
4004 exports[`test/place-dep.js TAP placement tests nest because globalStyle > warnings 1`] = `
4005 Array []
4006 `
4007
4008 exports[`test/place-dep.js TAP placement tests nest even though unnecessary, because legacy bundling > changes to tree 1`] = `
4009 --- expected
4010 +++ actual
4011 @@ -63,8 +63,7 @@
4012 "type": "prod",
4013 "name": "bar",
4014 "spec": "1",
4015 - "to": null,
4016 - "error": "MISSING",
4017 + "to": "node_modules/foo/node_modules/bar",
4018 },
4019 },
4020 "edgesIn": Set {
4021 @@ -75,6 +74,26 @@
4022 "from": "",
4023 },
4024 },
4025 + "children": Map {
4026 + "bar" => ArboristNode {
4027 + "name": "bar",
4028 + "version": "1.0.0",
4029 + "location": "node_modules/foo/node_modules/bar",
4030 + "path": "/some/path/node_modules/foo/node_modules/bar",
4031 + "extraneous": true,
4032 + "dev": true,
4033 + "optional": true,
4034 + "peer": true,
4035 + "edgesIn": Set {
4036 + EdgeIn {
4037 + "type": "prod",
4038 + "name": "bar",
4039 + "spec": "1",
4040 + "from": "node_modules/foo",
4041 + },
4042 + },
4043 + },
4044 + },
4045 },
4046 },
4047 }
4048
4049 `
4050
4051 exports[`test/place-dep.js TAP placement tests nest even though unnecessary, because legacy bundling > placements 1`] = `
4052 Array [
4053 Object {
4054 "canPlace": Symbol(OK),
4055 "canPlaceSelf": Symbol(OK),
4056 "checks": Map {
4057 "node_modules/foo" => Array [
4058 Symbol(OK),
4059 Symbol(OK),
4060 ],
4061 },
4062 "dep": "[email protected]",
4063 "edge": "{ node_modules/foo prod bar@1 }",
4064 "placed": "node_modules/foo/node_modules/bar",
4065 },
4066 ]
4067 `
4068
4069 exports[`test/place-dep.js TAP placement tests nest even though unnecessary, because legacy bundling > warnings 1`] = `
4070 Array []
4071 `
4072
4073 exports[`test/place-dep.js TAP placement tests nest only 1 level due to globalStyle > changes to tree 1`] = `
4074 --- expected
4075 +++ actual
4076 @@ -63,8 +63,7 @@
4077 "type": "prod",
4078 "name": "baz",
4079 "spec": "*",
4080 - "to": null,
4081 - "error": "MISSING",
4082 + "to": "node_modules/foo/node_modules/baz",
4083 },
4084 },
4085 "edgesIn": Set {
4086 @@ -76,6 +75,24 @@
4087 },
4088 },
4089 },
4090 + "baz" => ArboristNode {
4091 + "name": "baz",
4092 + "version": "1.0.0",
4093 + "location": "node_modules/foo/node_modules/baz",
4094 + "path": "/some/path/node_modules/foo/node_modules/baz",
4095 + "extraneous": true,
4096 + "dev": true,
4097 + "optional": true,
4098 + "peer": true,
4099 + "edgesIn": Set {
4100 + EdgeIn {
4101 + "type": "prod",
4102 + "name": "baz",
4103 + "spec": "*",
4104 + "from": "node_modules/foo/node_modules/bar",
4105 + },
4106 + },
4107 + },
4108 },
4109 },
4110 },
4111
4112 `
4113
4114 exports[`test/place-dep.js TAP placement tests nest only 1 level due to globalStyle > placements 1`] = `
4115 Array [
4116 Object {
4117 "canPlace": Symbol(OK),
4118 "canPlaceSelf": Symbol(OK),
4119 "checks": Map {
4120 "node_modules/foo/node_modules/bar" => Array [
4121 Symbol(OK),
4122 Symbol(OK),
4123 ],
4124 "node_modules/foo" => Array [
4125 Symbol(OK),
4126 Symbol(OK),
4127 ],
4128 },
4129 "dep": "[email protected]",
4130 "edge": "{ node_modules/foo/node_modules/bar prod baz@ }",
4131 "placed": "node_modules/foo/node_modules/baz",
4132 },
4133 ]
4134 `
4135
4136 exports[`test/place-dep.js TAP placement tests nest only 1 level due to globalStyle > warnings 1`] = `
4137 Array []
4138 `
4139
4140 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep > changes to tree 1`] = `
4141 --- expected
4142 +++ actual
4143 @@ -88,8 +88,7 @@
4144 "type": "prod",
4145 "name": "x",
4146 "spec": "2",
4147 - "to": null,
4148 - "error": "MISSING",
4149 + "to": "node_modules/k/node_modules/x",
4150 },
4151 },
4152 "edgesIn": Set {
4153 @@ -100,6 +99,52 @@
4154 "from": "",
4155 },
4156 },
4157 + "children": Map {
4158 + "x" => ArboristNode {
4159 + "name": "x",
4160 + "version": "2.0.0",
4161 + "location": "node_modules/k/node_modules/x",
4162 + "path": "/some/path/node_modules/k/node_modules/x",
4163 + "extraneous": true,
4164 + "dev": true,
4165 + "optional": true,
4166 + "peer": true,
4167 + "edgesOut": Map {
4168 + "y" => EdgeOut {
4169 + "type": "peer",
4170 + "name": "y",
4171 + "spec": "2",
4172 + "to": "node_modules/k/node_modules/y",
4173 + },
4174 + },
4175 + "edgesIn": Set {
4176 + EdgeIn {
4177 + "type": "prod",
4178 + "name": "x",
4179 + "spec": "2",
4180 + "from": "node_modules/k",
4181 + },
4182 + },
4183 + },
4184 + "y" => ArboristNode {
4185 + "name": "y",
4186 + "version": "2.0.0",
4187 + "location": "node_modules/k/node_modules/y",
4188 + "path": "/some/path/node_modules/k/node_modules/y",
4189 + "extraneous": true,
4190 + "dev": true,
4191 + "optional": true,
4192 + "peer": true,
4193 + "edgesIn": Set {
4194 + EdgeIn {
4195 + "type": "peer",
4196 + "name": "y",
4197 + "spec": "2",
4198 + "from": "node_modules/k/node_modules/x",
4199 + },
4200 + },
4201 + },
4202 + },
4203 },
4204 "y" => ArboristNode {
4205 "name": "y",
4206
4207 `
4208
4209 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep > placements 1`] = `
4210 Array [
4211 Object {
4212 "canPlace": Symbol(OK),
4213 "canPlaceSelf": Symbol(OK),
4214 "checks": Map {
4215 "node_modules/k" => Array [
4216 Symbol(OK),
4217 Symbol(OK),
4218 ],
4219 "" => Array [
4220 Symbol(CONFLICT),
4221 Symbol(OK),
4222 ],
4223 },
4224 "dep": "[email protected]",
4225 "edge": "{ node_modules/k prod x@2 }",
4226 "placed": "node_modules/k/node_modules/x",
4227 },
4228 Object {
4229 "canPlace": Symbol(OK),
4230 "canPlaceSelf": Symbol(OK),
4231 "checks": Map {
4232 "node_modules/k" => Array [
4233 Symbol(OK),
4234 Symbol(OK),
4235 ],
4236 "" => Array [
4237 Symbol(CONFLICT),
4238 Symbol(OK),
4239 ],
4240 },
4241 "dep": "[email protected]",
4242 "edge": "{ node_modules/k/node_modules/x peer y@2 }",
4243 "parent": "x",
4244 "placed": "node_modules/k/node_modules/y",
4245 },
4246 ]
4247 `
4248
4249 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep > warnings 1`] = `
4250 Array []
4251 `
4252
4253 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep, step 2 > changes to tree 1`] = `
4254 --- expected
4255 +++ actual
4256 @@ -114,8 +114,7 @@
4257 "type": "peer",
4258 "name": "y",
4259 "spec": "2",
4260 - "to": "node_modules/y",
4261 - "error": "INVALID",
4262 + "to": "node_modules/k/node_modules/y",
4263 },
4264 },
4265 "edgesIn": Set {
4266 @@ -127,6 +126,24 @@
4267 },
4268 },
4269 },
4270 + "y" => ArboristNode {
4271 + "name": "y",
4272 + "version": "2.0.0",
4273 + "location": "node_modules/k/node_modules/y",
4274 + "path": "/some/path/node_modules/k/node_modules/y",
4275 + "extraneous": true,
4276 + "dev": true,
4277 + "optional": true,
4278 + "peer": true,
4279 + "edgesIn": Set {
4280 + EdgeIn {
4281 + "type": "peer",
4282 + "name": "y",
4283 + "spec": "2",
4284 + "from": "node_modules/k/node_modules/x",
4285 + },
4286 + },
4287 + },
4288 },
4289 },
4290 "y" => ArboristNode {
4291 @@ -145,13 +162,6 @@
4292 "spec": "1",
4293 "from": "node_modules/b",
4294 },
4295 - EdgeIn {
4296 - "type": "peer",
4297 - "name": "y",
4298 - "spec": "2",
4299 - "error": "INVALID",
4300 - "from": "node_modules/k/node_modules/x",
4301 - },
4302 },
4303 },
4304 },
4305
4306 `
4307
4308 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep, step 2 > placements 1`] = `
4309 Array [
4310 Object {
4311 "canPlace": Symbol(OK),
4312 "canPlaceSelf": Symbol(OK),
4313 "checks": Map {
4314 "node_modules/k" => Array [
4315 Symbol(OK),
4316 Symbol(OK),
4317 ],
4318 "" => Array [
4319 Symbol(CONFLICT),
4320 Symbol(CONFLICT),
4321 ],
4322 },
4323 "dep": "[email protected]",
4324 "edge": "{ node_modules/k/node_modules/x peer y@2 }",
4325 "placed": "node_modules/k/node_modules/y",
4326 },
4327 ]
4328 `
4329
4330 exports[`test/place-dep.js TAP placement tests nest peer set of non-root dep, step 2 > warnings 1`] = `
4331 Array []
4332 `
4333
4334 exports[`test/place-dep.js TAP placement tests nest peer set under dependent node > changes to tree 1`] = `
4335 --- expected
4336 +++ actual
4337 @@ -38,8 +38,7 @@
4338 "type": "prod",
4339 "name": "b",
4340 "spec": "1",
4341 - "to": "node_modules/b",
4342 - "error": "INVALID",
4343 + "to": "node_modules/a/node_modules/b",
4344 },
4345 },
4346 "edgesIn": Set {
4347 @@ -50,6 +49,52 @@
4348 "from": "",
4349 },
4350 },
4351 + "children": Map {
4352 + "b" => ArboristNode {
4353 + "name": "b",
4354 + "version": "1.0.1",
4355 + "location": "node_modules/a/node_modules/b",
4356 + "path": "/some/path/node_modules/a/node_modules/b",
4357 + "extraneous": true,
4358 + "dev": true,
4359 + "optional": true,
4360 + "peer": true,
4361 + "edgesOut": Map {
4362 + "c" => EdgeOut {
4363 + "type": "peer",
4364 + "name": "c",
4365 + "spec": "1",
4366 + "to": "node_modules/a/node_modules/c",
4367 + },
4368 + },
4369 + "edgesIn": Set {
4370 + EdgeIn {
4371 + "type": "prod",
4372 + "name": "b",
4373 + "spec": "1",
4374 + "from": "node_modules/a",
4375 + },
4376 + },
4377 + },
4378 + "c" => ArboristNode {
4379 + "name": "c",
4380 + "version": "1.0.1",
4381 + "location": "node_modules/a/node_modules/c",
4382 + "path": "/some/path/node_modules/a/node_modules/c",
4383 + "extraneous": true,
4384 + "dev": true,
4385 + "optional": true,
4386 + "peer": true,
4387 + "edgesIn": Set {
4388 + EdgeIn {
4389 + "type": "peer",
4390 + "name": "c",
4391 + "spec": "1",
4392 + "from": "node_modules/a/node_modules/b",
4393 + },
4394 + },
4395 + },
4396 + },
4397 },
4398 "b" => ArboristNode {
4399 "name": "b",
4400 @@ -75,13 +120,6 @@
4401 "spec": "2",
4402 "from": "node_modules/d",
4403 },
4404 - EdgeIn {
4405 - "type": "prod",
4406 - "name": "b",
4407 - "spec": "1",
4408 - "error": "INVALID",
4409 - "from": "node_modules/a",
4410 - },
4411 },
4412 },
4413 "c" => ArboristNode {
4414
4415 `
4416
4417 exports[`test/place-dep.js TAP placement tests nest peer set under dependent node > placements 1`] = `
4418 Array [
4419 Object {
4420 "canPlace": Symbol(OK),
4421 "canPlaceSelf": Symbol(OK),
4422 "checks": Map {
4423 "node_modules/a" => Array [
4424 Symbol(OK),
4425 Symbol(OK),
4426 ],
4427 "" => Array [
4428 Symbol(CONFLICT),
4429 Symbol(CONFLICT),
4430 ],
4431 },
4432 "dep": "[email protected]",
4433 "edge": "{ node_modules/a prod b@1 }",
4434 "placed": "node_modules/a/node_modules/b",
4435 },
4436 Object {
4437 "canPlace": Symbol(OK),
4438 "canPlaceSelf": Symbol(OK),
4439 "checks": Map {
4440 "node_modules/a" => Array [
4441 Symbol(OK),
4442 Symbol(OK),
4443 ],
4444 "" => Array [
4445 Symbol(CONFLICT),
4446 Symbol(CONFLICT),
4447 ],
4448 },
4449 "dep": "[email protected]",
4450 "edge": "{ node_modules/a/node_modules/b peer c@1 }",
4451 "parent": "b",
4452 "placed": "node_modules/a/node_modules/c",
4453 },
4454 ]
4455 `
4456
4457 exports[`test/place-dep.js TAP placement tests nest peer set under dependent node > warnings 1`] = `
4458 Array []
4459 `
4460
4461 exports[`test/place-dep.js TAP placement tests pathologically nested dependency cycle > changes to tree 1`] = `
4462 --- expected
4463 +++ actual
4464 @@ -118,13 +118,6 @@
4465 "spec": "2",
4466 "from": "node_modules/b/node_modules/a",
4467 },
4468 - EdgeIn {
4469 - "type": "prod",
4470 - "name": "b",
4471 - "spec": "1",
4472 - "error": "INVALID",
4473 - "from": "node_modules/b/node_modules/b/node_modules/a",
4474 - },
4475 },
4476 "children": Map {
4477 "a" => ArboristNode {
4478 @@ -141,8 +134,7 @@
4479 "type": "prod",
4480 "name": "b",
4481 "spec": "1",
4482 - "to": "node_modules/b/node_modules/b",
4483 - "error": "INVALID",
4484 + "to": "node_modules/b/node_modules/b/node_modules/b",
4485 },
4486 },
4487 "edgesIn": Set {
4488 @@ -154,6 +146,29 @@
4489 },
4490 },
4491 },
4492 + "b" => ArboristLink {
4493 + "name": "b",
4494 + "version": "1.0.0",
4495 + "location": "node_modules/b/node_modules/b/node_modules/b",
4496 + "path": "/some/path/node_modules/b/node_modules/b/node_modules/b",
4497 + "realpath": "/some/path/node_modules/b",
4498 + "resolved": "file:../../..",
4499 + "extraneous": true,
4500 + "dev": true,
4501 + "optional": true,
4502 + "peer": true,
4503 + "edgesIn": Set {
4504 + EdgeIn {
4505 + "type": "prod",
4506 + "name": "b",
4507 + "spec": "1",
4508 + "from": "node_modules/b/node_modules/b/node_modules/a",
4509 + },
4510 + },
4511 + "target": ArboristNode {
4512 + "location": "node_modules/b",
4513 + },
4514 + },
4515 },
4516 },
4517 },
4518
4519 `
4520
4521 exports[`test/place-dep.js TAP placement tests pathologically nested dependency cycle > placements 1`] = `
4522 Array [
4523 Object {
4524 "canPlace": Symbol(OK),
4525 "canPlaceSelf": Symbol(OK),
4526 "checks": Map {
4527 "node_modules/b/node_modules/b/node_modules/a" => Array [
4528 Symbol(OK),
4529 Symbol(OK),
4530 ],
4531 "node_modules/b/node_modules/b" => Array [
4532 Symbol(OK),
4533 Symbol(OK),
4534 ],
4535 "node_modules/b" => Array [
4536 Symbol(CONFLICT),
4537 Symbol(CONFLICT),
4538 ],
4539 },
4540 "dep": "[email protected]",
4541 "edge": "{ node_modules/b/node_modules/b/node_modules/a prod b@1 }",
4542 "placed": "node_modules/b/node_modules/b/node_modules/b",
4543 },
4544 ]
4545 `
4546
4547 exports[`test/place-dep.js TAP placement tests pathologically nested dependency cycle > warnings 1`] = `
4548 Array []
4549 `
4550
4551 exports[`test/place-dep.js TAP placement tests peer all the way down, conflict but not ours > changes to tree 1`] = `
4552 --- expected
4553 +++ actual
4554 @@ -106,8 +106,7 @@
4555 "type": "prod",
4556 "name": "d",
4557 "spec": "1",
4558 - "to": "node_modules/d",
4559 - "error": "INVALID",
4560 + "to": "node_modules/b/node_modules/c/node_modules/d",
4561 },
4562 "p" => EdgeOut {
4563 "type": "peer",
4564 @@ -124,6 +123,36 @@
4565 "from": "node_modules/b",
4566 },
4567 },
4568 + "children": Map {
4569 + "d" => ArboristNode {
4570 + "name": "d",
4571 + "version": "1.0.0",
4572 + "location": "node_modules/b/node_modules/c/node_modules/d",
4573 + "path": "/some/path/node_modules/b/node_modules/c/node_modules/d",
4574 + "extraneous": true,
4575 + "dev": true,
4576 + "optional": true,
4577 + "peer": true,
4578 + "edgesOut": Map {
4579 + "p" => EdgeOut {
4580 + "type": "peer",
4581 + "name": "p",
4582 + "spec": "1",
4583 + "error": "INVALID",
4584 + "peerConflicted": true,
4585 + "to": "node_modules/p",
4586 + },
4587 + },
4588 + "edgesIn": Set {
4589 + EdgeIn {
4590 + "type": "prod",
4591 + "name": "d",
4592 + "spec": "1",
4593 + "from": "node_modules/b/node_modules/c",
4594 + },
4595 + },
4596 + },
4597 + },
4598 },
4599 },
4600 },
4601 @@ -177,13 +206,6 @@
4602 "spec": "2",
4603 "from": "node_modules/b",
4604 },
4605 - EdgeIn {
4606 - "type": "prod",
4607 - "name": "d",
4608 - "spec": "1",
4609 - "error": "INVALID",
4610 - "from": "node_modules/b/node_modules/c",
4611 - },
4612 },
4613 },
4614 "p" => ArboristNode {
4615 @@ -217,6 +239,14 @@
4616 EdgeIn {
4617 "type": "peer",
4618 "name": "p",
4619 + "spec": "1",
4620 + "error": "INVALID",
4621 + "peerConflicted": true,
4622 + "from": "node_modules/b/node_modules/c/node_modules/d",
4623 + },
4624 + EdgeIn {
4625 + "type": "peer",
4626 + "name": "p",
4627 "spec": "*",
4628 "from": "node_modules/c",
4629 },
4630
4631 `
4632
4633 exports[`test/place-dep.js TAP placement tests peer all the way down, conflict but not ours > placements 1`] = `
4634 Array [
4635 Object {
4636 "canPlace": Symbol(CONFLICT),
4637 "canPlaceSelf": Symbol(OK),
4638 "checks": Map {
4639 "node_modules/b/node_modules/c" => Array [
4640 Symbol(CONFLICT),
4641 Symbol(OK),
4642 ],
4643 },
4644 "dep": "[email protected]",
4645 "edge": "{ node_modules/b/node_modules/c prod d@1 }",
4646 "placed": "node_modules/b/node_modules/c/node_modules/d",
4647 },
4648 Object {
4649 "canPlace": null,
4650 "canPlaceSelf": null,
4651 "checks": Map {
4652 "node_modules/b/node_modules/c" => Array [
4653 Symbol(CONFLICT),
4654 Symbol(OK),
4655 ],
4656 },
4657 "dep": "[email protected]",
4658 "edge": "{ node_modules/b/node_modules/c/node_modules/d peer p@1 }",
4659 "parent": "d",
4660 "placed": null,
4661 },
4662 ]
4663 `
4664
4665 exports[`test/place-dep.js TAP placement tests peer all the way down, conflict but not ours > warnings 1`] = `
4666 Array [
4667 Array [
4668 "ERESOLVE",
4669 "overriding peer dependency",
4670 Object {
4671 "code": "ERESOLVE",
4672 "current": Object {
4673 "dependents": Array [
4674 Object {
4675 "error": "INVALID",
4676 "from": Object {
4677 "dependents": Array [
4678 Object {
4679 "from": Object {
4680 "dependents": Array [
4681 Object {
4682 "from": Object {
4683 "dependents": Array [
4684 Object {
4685 "from": Object {
4686 "dependents": Array [
4687 Object {
4688 "from": Object {
4689 "location": "/some/path",
4690 },
4691 "name": "a",
4692 "spec": "",
4693 "type": "prod",
4694 },
4695 ],
4696 "isWorkspace": false,
4697 "location": "node_modules/a",
4698 "name": "a",
4699 "version": "1.0.0",
4700 },
4701 "name": "b",
4702 "spec": "",
4703 "type": "prod",
4704 },
4705 ],
4706 "isWorkspace": false,
4707 "location": "node_modules/b",
4708 "name": "b",
4709 "version": "1.0.0",
4710 },
4711 "name": "c",
4712 "spec": "1",
4713 "type": "prod",
4714 },
4715 ],
4716 "isWorkspace": false,
4717 "location": "node_modules/b/node_modules/c",
4718 "name": "c",
4719 "version": "1.0.0",
4720 },
4721 "name": "d",
4722 "spec": "1",
4723 "type": "prod",
4724 },
4725 ],
4726 "isWorkspace": false,
4727 "location": "node_modules/b/node_modules/c/node_modules/d",
4728 "name": "d",
4729 "version": "1.0.0",
4730 },
4731 "name": "p",
4732 "spec": "1",
4733 "type": "peer",
4734 },
4735 ],
4736 "isWorkspace": false,
4737 "location": "node_modules/p",
4738 "name": "p",
4739 "version": "2.0.0",
4740 },
4741 "dep": Object {
4742 "dependents": Array [
4743 Object {
4744 "error": "INVALID",
4745 "from": Object {
4746 "dependents": Array [
4747 Object {
4748 "from": Object {
4749 "dependents": Array [
4750 Object {
4751 "from": Object {
4752 "dependents": Array [
4753 Object {
4754 "from": Object {
4755 "dependents": Array [
4756 Object {
4757 "from": Object {
4758 "location": "/some/path",
4759 },
4760 "name": "a",
4761 "spec": "",
4762 "type": "prod",
4763 },
4764 ],
4765 "isWorkspace": false,
4766 "location": "node_modules/a",
4767 "name": "a",
4768 "version": "1.0.0",
4769 },
4770 "name": "b",
4771 "spec": "",
4772 "type": "prod",
4773 },
4774 ],
4775 "isWorkspace": false,
4776 "location": "node_modules/b",
4777 "name": "b",
4778 "version": "1.0.0",
4779 },
4780 "name": "c",
4781 "spec": "1",
4782 "type": "prod",
4783 },
4784 ],
4785 "isWorkspace": false,
4786 "location": "node_modules/b/node_modules/c",
4787 "name": "c",
4788 "version": "1.0.0",
4789 },
4790 "name": "d",
4791 "spec": "1",
4792 "type": "prod",
4793 },
4794 ],
4795 "isWorkspace": false,
4796 "location": "node_modules/b/node_modules/c/node_modules/d",
4797 "name": "d",
4798 "version": "1.0.0",
4799 },
4800 "name": "p",
4801 "spec": "1",
4802 "type": "peer",
4803 },
4804 ],
4805 "isWorkspace": false,
4806 "location": "node_modules/p",
4807 "name": "p",
4808 "version": "1.0.0",
4809 "whileInstalling": Object {
4810 "name": "c",
4811 "path": "/some/path/node_modules/b/node_modules/c",
4812 "version": "1.0.0",
4813 },
4814 },
4815 "edge": Object {
4816 "error": "INVALID",
4817 "from": Object {
4818 "dependents": Array [
4819 Object {
4820 "from": Object {
4821 "dependents": Array [
4822 Object {
4823 "from": Object {
4824 "dependents": Array [
4825 Object {
4826 "from": Object {
4827 "dependents": Array [
4828 Object {
4829 "from": Object {
4830 "location": "/some/path",
4831 },
4832 "name": "a",
4833 "spec": "",
4834 "type": "prod",
4835 },
4836 ],
4837 "isWorkspace": false,
4838 "location": "node_modules/a",
4839 "name": "a",
4840 "version": "1.0.0",
4841 },
4842 "name": "b",
4843 "spec": "",
4844 "type": "prod",
4845 },
4846 ],
4847 "isWorkspace": false,
4848 "location": "node_modules/b",
4849 "name": "b",
4850 "version": "1.0.0",
4851 },
4852 "name": "c",
4853 "spec": "1",
4854 "type": "prod",
4855 },
4856 ],
4857 "isWorkspace": false,
4858 "location": "node_modules/b/node_modules/c",
4859 "name": "c",
4860 "version": "1.0.0",
4861 },
4862 "name": "d",
4863 "spec": "1",
4864 "type": "prod",
4865 },
4866 ],
4867 "isWorkspace": false,
4868 "location": "node_modules/b/node_modules/c/node_modules/d",
4869 "name": "d",
4870 "version": "1.0.0",
4871 },
4872 "name": "p",
4873 "spec": "1",
4874 "type": "peer",
4875 },
4876 "force": false,
4877 "isMine": false,
4878 "peerConflict": Object {
4879 "dependents": Array [
4880 Object {
4881 "error": "INVALID",
4882 "from": Object {
4883 "dependents": Array [
4884 Object {
4885 "from": Object {
4886 "dependents": Array [
4887 Object {
4888 "from": Object {
4889 "dependents": Array [
4890 Object {
4891 "from": Object {
4892 "dependents": Array [
4893 Object {
4894 "from": Object {
4895 "location": "/some/path",
4896 },
4897 "name": "a",
4898 "spec": "",
4899 "type": "prod",
4900 },
4901 ],
4902 "isWorkspace": false,
4903 "location": "node_modules/a",
4904 "name": "a",
4905 "version": "1.0.0",
4906 },
4907 "name": "b",
4908 "spec": "",
4909 "type": "prod",
4910 },
4911 ],
4912 "isWorkspace": false,
4913 "location": "node_modules/b",
4914 "name": "b",
4915 "version": "1.0.0",
4916 },
4917 "name": "c",
4918 "spec": "1",
4919 "type": "prod",
4920 },
4921 ],
4922 "isWorkspace": false,
4923 "location": "node_modules/b/node_modules/c",
4924 "name": "c",
4925 "version": "1.0.0",
4926 },
4927 "name": "d",
4928 "spec": "1",
4929 "type": "prod",
4930 },
4931 ],
4932 "isWorkspace": false,
4933 "location": "node_modules/b/node_modules/c/node_modules/d",
4934 "name": "d",
4935 "version": "1.0.0",
4936 },
4937 "name": "p",
4938 "spec": "1",
4939 "type": "peer",
4940 },
4941 ],
4942 "isWorkspace": false,
4943 "location": "node_modules/p",
4944 "name": "p",
4945 "version": "2.0.0",
4946 },
4947 "strictPeerDeps": false,
4948 },
4949 ],
4950 ]
4951 `
4952
4953 exports[`test/place-dep.js TAP placement tests peer with peers > changes to tree 1`] = `
4954 --- expected
4955 +++ actual
4956 @@ -14,8 +14,79 @@
4957 "type": "prod",
4958 "name": "a",
4959 "spec": "1.x",
4960 - "to": null,
4961 - "error": "MISSING",
4962 + "to": "node_modules/a",
4963 },
4964 },
4965 + "children": Map {
4966 + "a" => ArboristNode {
4967 + "name": "a",
4968 + "version": "1.2.3",
4969 + "location": "node_modules/a",
4970 + "path": "/some/path/node_modules/a",
4971 + "extraneous": true,
4972 + "dev": true,
4973 + "optional": true,
4974 + "peer": true,
4975 + "edgesOut": Map {
4976 + "b" => EdgeOut {
4977 + "type": "peer",
4978 + "name": "b",
4979 + "spec": "1",
4980 + "to": "node_modules/b",
4981 + },
4982 + },
4983 + "edgesIn": Set {
4984 + EdgeIn {
4985 + "type": "prod",
4986 + "name": "a",
4987 + "spec": "1.x",
4988 + "from": "",
4989 + },
4990 + },
4991 + },
4992 + "b" => ArboristNode {
4993 + "name": "b",
4994 + "version": "1.2.3",
4995 + "location": "node_modules/b",
4996 + "path": "/some/path/node_modules/b",
4997 + "extraneous": true,
4998 + "dev": true,
4999 + "optional": true,
5000 + "peer": true,
5001 + "edgesOut": Map {
5002 + "c" => EdgeOut {
5003 + "type": "peer",
5004 + "name": "c",
5005 + "spec": "1",
5006 + "to": "node_modules/c",
5007 + },
5008 + },
5009 + "edgesIn": Set {
5010 + EdgeIn {
5011 + "type": "peer",
5012 + "name": "b",
5013 + "spec": "1",
5014 + "from": "node_modules/a",
5015 + },
5016 + },
5017 + },
5018 + "c" => ArboristNode {
5019 + "name": "c",
5020 + "version": "1.2.3",
5021 + "location": "node_modules/c",
5022 + "path": "/some/path/node_modules/c",
5023 + "extraneous": true,
5024 + "dev": true,
5025 + "optional": true,
5026 + "peer": true,
5027 + "edgesIn": Set {
5028 + EdgeIn {
5029 + "type": "peer",
5030 + "name": "c",
5031 + "spec": "1",
5032 + "from": "node_modules/b",
5033 + },
5034 + },
5035 + },
5036 + },
5037 }
5038
5039 `
5040
5041 exports[`test/place-dep.js TAP placement tests peer with peers > placements 1`] = `
5042 Array [
5043 Object {
5044 "canPlace": Symbol(OK),
5045 "canPlaceSelf": Symbol(OK),
5046 "checks": Map {
5047 "" => Array [
5048 Symbol(OK),
5049 Symbol(OK),
5050 ],
5051 },
5052 "dep": "[email protected]",
5053 "edge": "{ ROOT prod [email protected] }",
5054 "placed": "node_modules/a",
5055 },
5056 Object {
5057 "canPlace": Symbol(OK),
5058 "canPlaceSelf": Symbol(OK),
5059 "checks": Map {
5060 "" => Array [
5061 Symbol(OK),
5062 Symbol(OK),
5063 ],
5064 },
5065 "dep": "[email protected]",
5066 "edge": "{ node_modules/a peer b@1 }",
5067 "parent": "a",
5068 "placed": "node_modules/b",
5069 },
5070 Object {
5071 "canPlace": Symbol(OK),
5072 "canPlaceSelf": Symbol(OK),
5073 "checks": Map {
5074 "" => Array [
5075 Symbol(OK),
5076 Symbol(OK),
5077 ],
5078 },
5079 "dep": "[email protected]",
5080 "edge": "{ node_modules/b peer c@1 }",
5081 "parent": "b",
5082 "placed": "node_modules/c",
5083 },
5084 ]
5085 `
5086
5087 exports[`test/place-dep.js TAP placement tests peer with peers > warnings 1`] = `
5088 Array []
5089 `
5090
5091 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet > changes to tree 1`] = `
5092 --- expected
5093 +++ actual
5094 @@ -14,8 +14,109 @@
5095 "type": "prod",
5096 "name": "a",
5097 "spec": "1.x",
5098 - "to": null,
5099 - "error": "MISSING",
5100 + "to": "node_modules/a",
5101 },
5102 },
5103 + "children": Map {
5104 + "a" => ArboristNode {
5105 + "name": "a",
5106 + "version": "1.2.3",
5107 + "location": "node_modules/a",
5108 + "path": "/some/path/node_modules/a",
5109 + "extraneous": true,
5110 + "dev": true,
5111 + "optional": true,
5112 + "peer": true,
5113 + "edgesOut": Map {
5114 + "b" => EdgeOut {
5115 + "type": "peer",
5116 + "name": "b",
5117 + "spec": "1",
5118 + "to": "node_modules/b",
5119 + },
5120 + },
5121 + "edgesIn": Set {
5122 + EdgeIn {
5123 + "type": "prod",
5124 + "name": "a",
5125 + "spec": "1.x",
5126 + "from": "",
5127 + },
5128 + EdgeIn {
5129 + "type": "peer",
5130 + "name": "a",
5131 + "spec": "2",
5132 + "error": "INVALID",
5133 + "from": "node_modules/c",
5134 + },
5135 + },
5136 + },
5137 + "b" => ArboristNode {
5138 + "name": "b",
5139 + "version": "1.2.3",
5140 + "location": "node_modules/b",
5141 + "path": "/some/path/node_modules/b",
5142 + "extraneous": true,
5143 + "dev": true,
5144 + "optional": true,
5145 + "peer": true,
5146 + "edgesOut": Map {
5147 + "c" => EdgeOut {
5148 + "type": "peer",
5149 + "name": "c",
5150 + "spec": "1",
5151 + "to": "node_modules/c",
5152 + },
5153 + },
5154 + "edgesIn": Set {
5155 + EdgeIn {
5156 + "type": "peer",
5157 + "name": "b",
5158 + "spec": "1",
5159 + "from": "node_modules/a",
5160 + },
5161 + EdgeIn {
5162 + "type": "peer",
5163 + "name": "b",
5164 + "spec": "2",
5165 + "error": "INVALID",
5166 + "from": "node_modules/c",
5167 + },
5168 + },
5169 + },
5170 + "c" => ArboristNode {
5171 + "name": "c",
5172 + "version": "1.2.3",
5173 + "location": "node_modules/c",
5174 + "path": "/some/path/node_modules/c",
5175 + "extraneous": true,
5176 + "dev": true,
5177 + "optional": true,
5178 + "peer": true,
5179 + "edgesOut": Map {
5180 + "a" => EdgeOut {
5181 + "type": "peer",
5182 + "name": "a",
5183 + "spec": "2",
5184 + "error": "INVALID",
5185 + "to": "node_modules/a",
5186 + },
5187 + "b" => EdgeOut {
5188 + "type": "peer",
5189 + "name": "b",
5190 + "spec": "2",
5191 + "error": "INVALID",
5192 + "to": "node_modules/b",
5193 + },
5194 + },
5195 + "edgesIn": Set {
5196 + EdgeIn {
5197 + "type": "peer",
5198 + "name": "c",
5199 + "spec": "1",
5200 + "from": "node_modules/b",
5201 + },
5202 + },
5203 + },
5204 + },
5205 }
5206
5207 `
5208
5209 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet > placements 1`] = `
5210 Array [
5211 Object {
5212 "canPlace": Symbol(OK),
5213 "canPlaceSelf": Symbol(OK),
5214 "checks": Map {
5215 "" => Array [
5216 Symbol(OK),
5217 Symbol(OK),
5218 ],
5219 },
5220 "dep": "[email protected]",
5221 "edge": "{ ROOT prod [email protected] }",
5222 "placed": "node_modules/a",
5223 },
5224 Object {
5225 "canPlace": Symbol(OK),
5226 "canPlaceSelf": Symbol(OK),
5227 "checks": Map {
5228 "" => Array [
5229 Symbol(OK),
5230 Symbol(OK),
5231 ],
5232 },
5233 "dep": "[email protected]",
5234 "edge": "{ node_modules/a peer b@1 }",
5235 "parent": "a",
5236 "placed": "node_modules/b",
5237 },
5238 Object {
5239 "canPlace": Symbol(OK),
5240 "canPlaceSelf": Symbol(OK),
5241 "checks": Map {
5242 "" => Array [
5243 Symbol(OK),
5244 Symbol(OK),
5245 ],
5246 },
5247 "dep": "[email protected]",
5248 "edge": "{ node_modules/b peer c@1 }",
5249 "parent": "b",
5250 "placed": "node_modules/c",
5251 },
5252 ]
5253 `
5254
5255 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet > warnings 1`] = `
5256 Array []
5257 `
5258
5259 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > changes to tree 1`] = `
5260 --- expected
5261 +++ actual
5262 @@ -14,8 +14,7 @@
5263 "type": "prod",
5264 "name": "a",
5265 "spec": "1.x",
5266 - "to": null,
5267 - "error": "MISSING",
5268 + "to": "node_modules/a",
5269 },
5270 "c" => EdgeOut {
5271 "type": "prod",
5272 @@ -25,6 +24,73 @@
5273 },
5274 },
5275 "children": Map {
5276 + "a" => ArboristNode {
5277 + "name": "a",
5278 + "version": "1.2.3",
5279 + "location": "node_modules/a",
5280 + "path": "/some/path/node_modules/a",
5281 + "extraneous": true,
5282 + "dev": true,
5283 + "optional": true,
5284 + "peer": true,
5285 + "edgesOut": Map {
5286 + "b" => EdgeOut {
5287 + "type": "peer",
5288 + "name": "b",
5289 + "spec": "1",
5290 + "to": "node_modules/b",
5291 + },
5292 + },
5293 + "edgesIn": Set {
5294 + EdgeIn {
5295 + "type": "prod",
5296 + "name": "a",
5297 + "spec": "1.x",
5298 + "from": "",
5299 + },
5300 + EdgeIn {
5301 + "type": "peer",
5302 + "name": "a",
5303 + "spec": "2",
5304 + "error": "INVALID",
5305 + "from": "node_modules/c",
5306 + },
5307 + },
5308 + },
5309 + "b" => ArboristNode {
5310 + "name": "b",
5311 + "version": "1.2.3",
5312 + "location": "node_modules/b",
5313 + "path": "/some/path/node_modules/b",
5314 + "extraneous": true,
5315 + "dev": true,
5316 + "optional": true,
5317 + "peer": true,
5318 + "edgesOut": Map {
5319 + "c" => EdgeOut {
5320 + "type": "peer",
5321 + "name": "c",
5322 + "spec": "1",
5323 + "error": "INVALID",
5324 + "to": "node_modules/c",
5325 + },
5326 + },
5327 + "edgesIn": Set {
5328 + EdgeIn {
5329 + "type": "peer",
5330 + "name": "b",
5331 + "spec": "1",
5332 + "from": "node_modules/a",
5333 + },
5334 + EdgeIn {
5335 + "type": "peer",
5336 + "name": "b",
5337 + "spec": "2",
5338 + "error": "INVALID",
5339 + "from": "node_modules/c",
5340 + },
5341 + },
5342 + },
5343 "c" => ArboristNode {
5344 "name": "c",
5345 "version": "2.0.1",
5346 @@ -39,15 +105,15 @@
5347 "type": "peer",
5348 "name": "a",
5349 "spec": "2",
5350 - "error": "MISSING",
5351 - "to": null,
5352 + "error": "INVALID",
5353 + "to": "node_modules/a",
5354 },
5355 "b" => EdgeOut {
5356 "type": "peer",
5357 "name": "b",
5358 "spec": "2",
5359 - "error": "MISSING",
5360 - "to": null,
5361 + "error": "INVALID",
5362 + "to": "node_modules/b",
5363 },
5364 },
5365 "edgesIn": Set {
5366 @@ -57,6 +123,13 @@
5367 "spec": "2.x",
5368 "from": "",
5369 },
5370 + EdgeIn {
5371 + "type": "peer",
5372 + "name": "c",
5373 + "spec": "1",
5374 + "error": "INVALID",
5375 + "from": "node_modules/b",
5376 + },
5377 },
5378 },
5379 },
5380
5381 `
5382
5383 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > changes to tree 2`] = `
5384 --- expected
5385 +++ actual
5386 @@ -14,8 +14,7 @@
5387 "type": "prod",
5388 "name": "a",
5389 "spec": "1.x",
5390 - "to": null,
5391 - "error": "MISSING",
5392 + "to": "node_modules/a",
5393 },
5394 "c" => EdgeOut {
5395 "type": "prod",
5396 @@ -25,6 +24,73 @@
5397 },
5398 },
5399 "children": Map {
5400 + "a" => ArboristNode {
5401 + "name": "a",
5402 + "version": "1.2.3",
5403 + "location": "node_modules/a",
5404 + "path": "/some/path/node_modules/a",
5405 + "extraneous": true,
5406 + "dev": true,
5407 + "optional": true,
5408 + "peer": true,
5409 + "edgesOut": Map {
5410 + "b" => EdgeOut {
5411 + "type": "peer",
5412 + "name": "b",
5413 + "spec": "1",
5414 + "to": "node_modules/b",
5415 + },
5416 + },
5417 + "edgesIn": Set {
5418 + EdgeIn {
5419 + "type": "prod",
5420 + "name": "a",
5421 + "spec": "1.x",
5422 + "from": "",
5423 + },
5424 + EdgeIn {
5425 + "type": "peer",
5426 + "name": "a",
5427 + "spec": "2",
5428 + "error": "INVALID",
5429 + "from": "node_modules/c",
5430 + },
5431 + },
5432 + },
5433 + "b" => ArboristNode {
5434 + "name": "b",
5435 + "version": "1.2.3",
5436 + "location": "node_modules/b",
5437 + "path": "/some/path/node_modules/b",
5438 + "extraneous": true,
5439 + "dev": true,
5440 + "optional": true,
5441 + "peer": true,
5442 + "edgesOut": Map {
5443 + "c" => EdgeOut {
5444 + "type": "peer",
5445 + "name": "c",
5446 + "spec": "1",
5447 + "error": "INVALID",
5448 + "to": "node_modules/c",
5449 + },
5450 + },
5451 + "edgesIn": Set {
5452 + EdgeIn {
5453 + "type": "peer",
5454 + "name": "b",
5455 + "spec": "1",
5456 + "from": "node_modules/a",
5457 + },
5458 + EdgeIn {
5459 + "type": "peer",
5460 + "name": "b",
5461 + "spec": "2",
5462 + "error": "INVALID",
5463 + "from": "node_modules/c",
5464 + },
5465 + },
5466 + },
5467 "c" => ArboristNode {
5468 "name": "c",
5469 "version": "2.0.1",
5470 @@ -39,15 +105,15 @@
5471 "type": "peer",
5472 "name": "a",
5473 "spec": "2",
5474 - "error": "MISSING",
5475 - "to": null,
5476 + "error": "INVALID",
5477 + "to": "node_modules/a",
5478 },
5479 "b" => EdgeOut {
5480 "type": "peer",
5481 "name": "b",
5482 "spec": "2",
5483 - "error": "MISSING",
5484 - "to": null,
5485 + "error": "INVALID",
5486 + "to": "node_modules/b",
5487 },
5488 },
5489 "edgesIn": Set {
5490 @@ -57,6 +123,13 @@
5491 "spec": "2.x",
5492 "from": "",
5493 },
5494 + EdgeIn {
5495 + "type": "peer",
5496 + "name": "c",
5497 + "spec": "1",
5498 + "error": "INVALID",
5499 + "from": "node_modules/b",
5500 + },
5501 },
5502 },
5503 },
5504
5505 `
5506
5507 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > placements 1`] = `
5508 Array [
5509 Object {
5510 "canPlace": Symbol(OK),
5511 "canPlaceSelf": Symbol(OK),
5512 "checks": Map {
5513 "" => Array [
5514 Symbol(OK),
5515 Symbol(OK),
5516 ],
5517 },
5518 "dep": "[email protected]",
5519 "edge": "{ ROOT prod [email protected] }",
5520 "placed": "node_modules/a",
5521 },
5522 Object {
5523 "canPlace": Symbol(OK),
5524 "canPlaceSelf": Symbol(OK),
5525 "checks": Map {
5526 "" => Array [
5527 Symbol(OK),
5528 Symbol(OK),
5529 ],
5530 },
5531 "dep": "[email protected]",
5532 "edge": "{ node_modules/a peer b@1 }",
5533 "parent": "a",
5534 "placed": "node_modules/b",
5535 },
5536 ]
5537 `
5538
5539 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > placements 2`] = `
5540 Array [
5541 Object {
5542 "canPlace": Symbol(OK),
5543 "canPlaceSelf": Symbol(OK),
5544 "checks": Map {
5545 "" => Array [
5546 Symbol(OK),
5547 Symbol(OK),
5548 ],
5549 },
5550 "dep": "[email protected]",
5551 "edge": "{ ROOT prod [email protected] }",
5552 "placed": "node_modules/a",
5553 },
5554 Object {
5555 "canPlace": Symbol(OK),
5556 "canPlaceSelf": Symbol(OK),
5557 "checks": Map {
5558 "" => Array [
5559 Symbol(OK),
5560 Symbol(OK),
5561 ],
5562 },
5563 "dep": "[email protected]",
5564 "edge": "{ node_modules/a peer b@1 }",
5565 "parent": "a",
5566 "placed": "node_modules/b",
5567 },
5568 ]
5569 `
5570
5571 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > warnings 1`] = `
5572 Array []
5573 `
5574
5575 exports[`test/place-dep.js TAP placement tests peers with peerConflicted edges in peerSet from dependent > warnings 2`] = `
5576 Array []
5577 `
5578
5579 exports[`test/place-dep.js TAP placement tests place a dep with an override > changes to tree 1`] = `
5580 --- expected
5581 +++ actual
5582 @@ -15,8 +15,30 @@
5583 "type": "prod",
5584 "name": "foo",
5585 "spec": "1",
5586 - "to": null,
5587 - "error": "MISSING",
5588 + "to": "node_modules/foo",
5589 },
5590 },
5591 + "children": Map {
5592 + "foo" => ArboristNode {
5593 + "name": "foo",
5594 + "version": "1.0.0",
5595 + "location": "node_modules/foo",
5596 + "path": "/some/path/node_modules/foo",
5597 + "extraneous": true,
5598 + "dev": true,
5599 + "optional": true,
5600 + "peer": true,
5601 + "overrides": Map {
5602 + "bar" => "2",
5603 + },
5604 + "edgesIn": Set {
5605 + EdgeIn {
5606 + "type": "prod",
5607 + "name": "foo",
5608 + "spec": "1",
5609 + "from": "",
5610 + },
5611 + },
5612 + },
5613 + },
5614 }
5615
5616 `
5617
5618 exports[`test/place-dep.js TAP placement tests place a dep with an override > placements 1`] = `
5619 Array [
5620 Object {
5621 "canPlace": Symbol(OK),
5622 "canPlaceSelf": Symbol(OK),
5623 "checks": Map {
5624 "" => Array [
5625 Symbol(OK),
5626 Symbol(OK),
5627 ],
5628 },
5629 "dep": "[email protected]",
5630 "edge": "{ ROOT prod foo@1 }",
5631 "placed": "node_modules/foo",
5632 },
5633 ]
5634 `
5635
5636 exports[`test/place-dep.js TAP placement tests place a dep with an override > warnings 1`] = `
5637 Array []
5638 `
5639
5640 exports[`test/place-dep.js TAP placement tests place a link dep > changes to tree 1`] = `
5641 --- expected
5642 +++ actual
5643 @@ -12,8 +12,7 @@
5644 "type": "prod",
5645 "name": "x",
5646 "spec": "file:x",
5647 - "to": null,
5648 - "error": "MISSING",
5649 + "to": "node_modules/x",
5650 },
5651 },
5652 "fsChildren": Set {
5653 @@ -28,4 +27,29 @@
5654 "peer": true,
5655 },
5656 },
5657 + "children": Map {
5658 + "x" => ArboristLink {
5659 + "name": "x",
5660 + "version": "1.2.3",
5661 + "location": "node_modules/x",
5662 + "path": "/some/path/node_modules/x",
5663 + "realpath": "/some/path/x",
5664 + "resolved": "file:../x",
5665 + "extraneous": true,
5666 + "dev": true,
5667 + "optional": true,
5668 + "peer": true,
5669 + "edgesIn": Set {
5670 + EdgeIn {
5671 + "type": "prod",
5672 + "name": "x",
5673 + "spec": "file:x",
5674 + "from": "",
5675 + },
5676 + },
5677 + "target": ArboristNode {
5678 + "location": "x",
5679 + },
5680 + },
5681 + },
5682 }
5683
5684 `
5685
5686 exports[`test/place-dep.js TAP placement tests place a link dep > placements 1`] = `
5687 Array [
5688 Object {
5689 "canPlace": Symbol(OK),
5690 "canPlaceSelf": Symbol(OK),
5691 "checks": Map {
5692 "" => Array [
5693 Symbol(OK),
5694 Symbol(OK),
5695 ],
5696 },
5697 "dep": "[email protected]",
5698 "edge": "{ ROOT prod x@file:x }",
5699 "placed": "node_modules/x",
5700 },
5701 ]
5702 `
5703
5704 exports[`test/place-dep.js TAP placement tests place a link dep > warnings 1`] = `
5705 Array []
5706 `
5707
5708 exports[`test/place-dep.js TAP placement tests prefer to dedupe rather than nest > changes to tree 1`] = `
5709 --- expected
5710 +++ actual
5711 @@ -24,7 +24,7 @@
5712 "children": Map {
5713 "bar" => ArboristNode {
5714 "name": "bar",
5715 - "version": "1.0.1",
5716 + "version": "1.0.0",
5717 "location": "node_modules/bar",
5718 "path": "/some/path/node_modules/bar",
5719 "extraneous": true,
5720 @@ -35,15 +35,14 @@
5721 EdgeIn {
5722 "type": "prod",
5723 "name": "bar",
5724 - "spec": "1",
5725 - "from": "node_modules/foo",
5726 + "spec": "1.0.0",
5727 + "from": "node_modules/baz",
5728 },
5729 EdgeIn {
5730 "type": "prod",
5731 "name": "bar",
5732 - "spec": "1.0.0",
5733 - "error": "INVALID",
5734 - "from": "node_modules/baz",
5735 + "spec": "1",
5736 + "from": "node_modules/foo",
5737 },
5738 },
5739 },
5740 @@ -62,7 +61,6 @@
5741 "name": "bar",
5742 "spec": "1.0.0",
5743 "to": "node_modules/bar",
5744 - "error": "INVALID",
5745 },
5746 },
5747 "edgesIn": Set {
5748
5749 `
5750
5751 exports[`test/place-dep.js TAP placement tests prefer to dedupe rather than nest > placements 1`] = `
5752 Array [
5753 Object {
5754 "canPlace": Symbol(REPLACE),
5755 "canPlaceSelf": Symbol(REPLACE),
5756 "checks": Map {
5757 "node_modules/baz" => Array [
5758 Symbol(OK),
5759 Symbol(OK),
5760 ],
5761 "" => Array [
5762 Symbol(REPLACE),
5763 Symbol(REPLACE),
5764 ],
5765 },
5766 "dep": "[email protected]",
5767 "edge": "{ node_modules/baz prod [email protected] }",
5768 "placed": "node_modules/bar",
5769 },
5770 ]
5771 `
5772
5773 exports[`test/place-dep.js TAP placement tests prefer to dedupe rather than nest > warnings 1`] = `
5774 Array []
5775 `
5776
5777 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, force, end of first step > changes to tree 1`] = `
5778 --- expected
5779 +++ actual
5780 @@ -52,6 +52,7 @@
5781 "name": "a",
5782 "spec": "2",
5783 "error": "INVALID",
5784 + "peerConflicted": true,
5785 "from": "node_modules/e",
5786 },
5787 },
5788 @@ -156,6 +157,7 @@
5789 "name": "a",
5790 "spec": "2",
5791 "error": "INVALID",
5792 + "peerConflicted": true,
5793 "to": "node_modules/a",
5794 },
5795 },
5796
5797 `
5798
5799 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, force, end of first step > placements 1`] = `
5800 Array [
5801 Object {
5802 "canPlace": null,
5803 "canPlaceSelf": null,
5804 "checks": Map {
5805 "" => Array [
5806 Symbol(CONFLICT),
5807 Symbol(CONFLICT),
5808 ],
5809 },
5810 "dep": "[email protected]",
5811 "edge": "{ node_modules/e peer a@2 }",
5812 "placed": null,
5813 },
5814 ]
5815 `
5816
5817 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, force, end of first step > warnings 1`] = `
5818 Array [
5819 Array [
5820 "ERESOLVE",
5821 "overriding peer dependency",
5822 Object {
5823 "code": "ERESOLVE",
5824 "current": Object {
5825 "dependents": Array [
5826 Object {
5827 "from": Object {
5828 "location": "/some/path",
5829 },
5830 "name": "a",
5831 "spec": "1",
5832 "type": "prod",
5833 },
5834 ],
5835 "isWorkspace": false,
5836 "location": "node_modules/a",
5837 "name": "a",
5838 "version": "1.0.0",
5839 },
5840 "dep": Object {
5841 "dependents": Array [
5842 Object {
5843 "error": "INVALID",
5844 "from": Object {
5845 "dependents": Array [
5846 Object {
5847 "from": Object {
5848 "dependents": Array [
5849 Object {
5850 "from": Object {
5851 "dependents": Array [
5852 Object {
5853 "from": Object {
5854 "dependents": Array [
5855 Object {
5856 "from": Object {
5857 "location": "/some/path",
5858 },
5859 "name": "b",
5860 "spec": "2",
5861 "type": "prod",
5862 },
5863 ],
5864 "isWorkspace": false,
5865 "location": "node_modules/b",
5866 "name": "b",
5867 "version": "2.0.0",
5868 },
5869 "name": "c",
5870 "spec": "2",
5871 "type": "peer",
5872 },
5873 ],
5874 "isWorkspace": false,
5875 "location": "node_modules/c",
5876 "name": "c",
5877 "version": "2.0.0",
5878 },
5879 "name": "d",
5880 "spec": "2",
5881 "type": "peer",
5882 },
5883 ],
5884 "isWorkspace": false,
5885 "location": "node_modules/d",
5886 "name": "d",
5887 "version": "2.0.0",
5888 },
5889 "name": "e",
5890 "spec": "2",
5891 "type": "peer",
5892 },
5893 ],
5894 "isWorkspace": false,
5895 "location": "node_modules/e",
5896 "name": "e",
5897 "version": "2.0.0",
5898 },
5899 "name": "a",
5900 "spec": "2",
5901 "type": "peer",
5902 },
5903 ],
5904 "isWorkspace": false,
5905 "location": "node_modules/a",
5906 "name": "a",
5907 "version": "2.0.0",
5908 "whileInstalling": Object {
5909 "name": "e",
5910 "path": "/some/path/node_modules/e",
5911 "version": "2.0.0",
5912 },
5913 },
5914 "edge": Object {
5915 "error": "INVALID",
5916 "from": Object {
5917 "dependents": Array [
5918 Object {
5919 "from": Object {
5920 "dependents": Array [
5921 Object {
5922 "from": Object {
5923 "dependents": Array [
5924 Object {
5925 "from": Object {
5926 "dependents": Array [
5927 Object {
5928 "from": Object {
5929 "location": "/some/path",
5930 },
5931 "name": "b",
5932 "spec": "2",
5933 "type": "prod",
5934 },
5935 ],
5936 "isWorkspace": false,
5937 "location": "node_modules/b",
5938 "name": "b",
5939 "version": "2.0.0",
5940 },
5941 "name": "c",
5942 "spec": "2",
5943 "type": "peer",
5944 },
5945 ],
5946 "isWorkspace": false,
5947 "location": "node_modules/c",
5948 "name": "c",
5949 "version": "2.0.0",
5950 },
5951 "name": "d",
5952 "spec": "2",
5953 "type": "peer",
5954 },
5955 ],
5956 "isWorkspace": false,
5957 "location": "node_modules/d",
5958 "name": "d",
5959 "version": "2.0.0",
5960 },
5961 "name": "e",
5962 "spec": "2",
5963 "type": "peer",
5964 },
5965 ],
5966 "isWorkspace": false,
5967 "location": "node_modules/e",
5968 "name": "e",
5969 "version": "2.0.0",
5970 },
5971 "name": "a",
5972 "spec": "2",
5973 "type": "peer",
5974 },
5975 "force": true,
5976 "isMine": true,
5977 "peerConflict": Object {
5978 "current": Object {
5979 "dependents": Array [
5980 Object {
5981 "from": Object {
5982 "location": "/some/path",
5983 },
5984 "name": "a",
5985 "spec": "1",
5986 "type": "prod",
5987 },
5988 ],
5989 "isWorkspace": false,
5990 "location": "node_modules/a",
5991 "name": "a",
5992 "version": "1.0.0",
5993 },
5994 "peer": Object {
5995 "dependents": Array [
5996 Object {
5997 "error": "INVALID",
5998 "from": Object {
5999 "dependents": Array [
6000 Object {
6001 "from": Object {
6002 "dependents": Array [
6003 Object {
6004 "from": Object {
6005 "dependents": Array [
6006 Object {
6007 "from": Object {
6008 "dependents": Array [
6009 Object {
6010 "from": Object {
6011 "location": "/some/path",
6012 },
6013 "name": "b",
6014 "spec": "2",
6015 "type": "prod",
6016 },
6017 ],
6018 "isWorkspace": false,
6019 "location": "node_modules/b",
6020 "name": "b",
6021 "version": "2.0.0",
6022 },
6023 "name": "c",
6024 "spec": "2",
6025 "type": "peer",
6026 },
6027 ],
6028 "isWorkspace": false,
6029 "location": "node_modules/c",
6030 "name": "c",
6031 "version": "2.0.0",
6032 },
6033 "name": "d",
6034 "spec": "2",
6035 "type": "peer",
6036 },
6037 ],
6038 "isWorkspace": false,
6039 "location": "node_modules/d",
6040 "name": "d",
6041 "version": "2.0.0",
6042 },
6043 "name": "e",
6044 "spec": "2",
6045 "type": "peer",
6046 },
6047 ],
6048 "isWorkspace": false,
6049 "location": "node_modules/e",
6050 "name": "e",
6051 "version": "2.0.0",
6052 },
6053 "name": "a",
6054 "spec": "2",
6055 "type": "peer",
6056 },
6057 ],
6058 "isWorkspace": false,
6059 "location": "node_modules/a",
6060 "name": "a",
6061 "version": "2.0.0",
6062 "whileInstalling": Object {
6063 "name": "e",
6064 "path": "/some/path/node_modules/e",
6065 "version": "2.0.0",
6066 },
6067 },
6068 },
6069 "strictPeerDeps": false,
6070 },
6071 ],
6072 ]
6073 `
6074
6075 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer > thrown error 1`] = `
6076 Error: could not resolve {
6077 "code": "ERESOLVE",
6078 "current": Object {
6079 "dependents": Array [
6080 Object {
6081 "from": Object {
6082 "dependents": Array [
6083 Object {
6084 "from": Object {
6085 "dependents": Array [
6086 Object {
6087 "from": Object {
6088 "dependents": Array [
6089 Object {
6090 "from": Object {
6091 "dependents": Array [
6092 Object {
6093 "from": Object {
6094 "name": "b",
6095 "version": "1.0.0",
6096 },
6097 "name": "c",
6098 "spec": "1",
6099 "type": "peer",
6100 },
6101 ],
6102 "isWorkspace": false,
6103 "location": "node_modules/c",
6104 "name": "c",
6105 "version": "1.0.0",
6106 },
6107 "name": "d",
6108 "spec": "1",
6109 "type": "peer",
6110 },
6111 ],
6112 "isWorkspace": false,
6113 "location": "node_modules/d",
6114 "name": "d",
6115 "version": "1.0.0",
6116 },
6117 "name": "e",
6118 "spec": "1",
6119 "type": "peer",
6120 },
6121 ],
6122 "isWorkspace": false,
6123 "location": "node_modules/e",
6124 "name": "e",
6125 "version": "1.0.0",
6126 },
6127 "name": "a",
6128 "spec": "1",
6129 "type": "peer",
6130 },
6131 Object {
6132 "from": Object {
6133 "location": "/some/path",
6134 },
6135 "name": "a",
6136 "spec": "1",
6137 "type": "prod",
6138 },
6139 ],
6140 "isWorkspace": false,
6141 "location": "node_modules/a",
6142 "name": "a",
6143 "version": "1.0.0",
6144 },
6145 "name": "b",
6146 "spec": "1",
6147 "type": "peer",
6148 },
6149 Object {
6150 "error": "INVALID",
6151 "from": Object {
6152 "location": "/some/path",
6153 },
6154 "name": "b",
6155 "spec": "2",
6156 "type": "prod",
6157 },
6158 ],
6159 "isWorkspace": false,
6160 "location": "node_modules/b",
6161 "name": "b",
6162 "version": "1.0.0",
6163 },
6164 "dep": Object {
6165 "dependents": Array [
6166 Object {
6167 "error": "INVALID",
6168 "from": Object {
6169 "location": "/some/path",
6170 },
6171 "name": "b",
6172 "spec": "2",
6173 "type": "prod",
6174 },
6175 ],
6176 "isWorkspace": false,
6177 "location": "node_modules/b",
6178 "name": "b",
6179 "version": "2.0.0",
6180 "whileInstalling": Object {
6181 "name": undefined,
6182 "path": "/some/path",
6183 "version": undefined,
6184 },
6185 },
6186 "edge": Object {
6187 "error": "INVALID",
6188 "from": Object {
6189 "location": "/some/path",
6190 },
6191 "name": "b",
6192 "spec": "2",
6193 "type": "prod",
6194 },
6195 "force": false,
6196 "isMine": true,
6197 "name": "Error",
6198 "peerConflict": Object {
6199 "current": Object {
6200 "dependents": Array [
6201 Object {
6202 "from": Object {
6203 "name": "b",
6204 "version": "1.0.0",
6205 },
6206 "name": "c",
6207 "spec": "1",
6208 "type": "peer",
6209 },
6210 ],
6211 "isWorkspace": false,
6212 "location": "node_modules/c",
6213 "name": "c",
6214 "version": "1.0.0",
6215 },
6216 "peer": Object {
6217 "dependents": Array [
6218 Object {
6219 "from": Object {
6220 "dependents": Array [
6221 Object {
6222 "error": "INVALID",
6223 "from": Object {
6224 "location": "/some/path",
6225 },
6226 "name": "b",
6227 "spec": "2",
6228 "type": "prod",
6229 },
6230 ],
6231 "isWorkspace": false,
6232 "location": "node_modules/b",
6233 "name": "b",
6234 "version": "2.0.0",
6235 "whileInstalling": Object {
6236 "name": undefined,
6237 "path": "/some/path",
6238 "version": undefined,
6239 },
6240 },
6241 "name": "c",
6242 "spec": "2",
6243 "type": "peer",
6244 },
6245 ],
6246 "isWorkspace": false,
6247 "location": "node_modules/c",
6248 "name": "c",
6249 "version": "2.0.0",
6250 "whileInstalling": Object {
6251 "name": undefined,
6252 "path": "/some/path",
6253 "version": undefined,
6254 },
6255 },
6256 },
6257 "strictPeerDeps": false,
6258 }
6259 `
6260
6261 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, force > changes to tree 1`] = `
6262 --- expected
6263 +++ actual
6264 @@ -19,7 +19,6 @@
6265 "name": "b",
6266 "spec": "2",
6267 "to": "node_modules/b",
6268 - "error": "INVALID",
6269 },
6270 },
6271 "children": Map {
6272 @@ -37,6 +36,8 @@
6273 "type": "peer",
6274 "name": "b",
6275 "spec": "1",
6276 + "error": "INVALID",
6277 + "peerConflicted": true,
6278 "to": "node_modules/b",
6279 },
6280 },
6281 @@ -47,17 +48,11 @@
6282 "spec": "1",
6283 "from": "",
6284 },
6285 - EdgeIn {
6286 - "type": "peer",
6287 - "name": "a",
6288 - "spec": "1",
6289 - "from": "node_modules/e",
6290 - },
6291 },
6292 },
6293 "b" => ArboristNode {
6294 "name": "b",
6295 - "version": "1.0.0",
6296 + "version": "2.0.0",
6297 "location": "node_modules/b",
6298 "path": "/some/path/node_modules/b",
6299 "extraneous": true,
6300 @@ -68,8 +63,9 @@
6301 "c" => EdgeOut {
6302 "type": "peer",
6303 "name": "c",
6304 - "spec": "1",
6305 - "to": "node_modules/c",
6306 + "spec": "2",
6307 + "error": "MISSING",
6308 + "to": null,
6309 },
6310 },
6311 "edgesIn": Set {
6312 @@ -77,94 +73,17 @@
6313 "type": "prod",
6314 "name": "b",
6315 "spec": "2",
6316 - "error": "INVALID",
6317 "from": "",
6318 },
6319 EdgeIn {
6320 "type": "peer",
6321 "name": "b",
6322 "spec": "1",
6323 + "error": "INVALID",
6324 + "peerConflicted": true,
6325 "from": "node_modules/a",
6326 },
6327 },
6328 },
6329 - "c" => ArboristNode {
6330 - "name": "c",
6331 - "version": "1.0.0",
6332 - "location": "node_modules/c",
6333 - "path": "/some/path/node_modules/c",
6334 - "extraneous": true,
6335 - "dev": true,
6336 - "optional": true,
6337 - "peer": true,
6338 - "edgesOut": Map {
6339 - "d" => EdgeOut {
6340 - "type": "peer",
6341 - "name": "d",
6342 - "spec": "1",
6343 - "to": "node_modules/d",
6344 - },
6345 - },
6346 - "edgesIn": Set {
6347 - EdgeIn {
6348 - "type": "peer",
6349 - "name": "c",
6350 - "spec": "1",
6351 - "from": "node_modules/b",
6352 - },
6353 - },
6354 - },
6355 - "d" => ArboristNode {
6356 - "name": "d",
6357 - "version": "1.0.0",
6358 - "location": "node_modules/d",
6359 - "path": "/some/path/node_modules/d",
6360 - "extraneous": true,
6361 - "dev": true,
6362 - "optional": true,
6363 - "peer": true,
6364 - "edgesOut": Map {
6365 - "e" => EdgeOut {
6366 - "type": "peer",
6367 - "name": "e",
6368 - "spec": "1",
6369 - "to": "node_modules/e",
6370 - },
6371 - },
6372 - "edgesIn": Set {
6373 - EdgeIn {
6374 - "type": "peer",
6375 - "name": "d",
6376 - "spec": "1",
6377 - "from": "node_modules/c",
6378 - },
6379 - },
6380 - },
6381 - "e" => ArboristNode {
6382 - "name": "e",
6383 - "version": "1.0.0",
6384 - "location": "node_modules/e",
6385 - "path": "/some/path/node_modules/e",
6386 - "extraneous": true,
6387 - "dev": true,
6388 - "optional": true,
6389 - "peer": true,
6390 - "edgesOut": Map {
6391 - "a" => EdgeOut {
6392 - "type": "peer",
6393 - "name": "a",
6394 - "spec": "1",
6395 - "to": "node_modules/a",
6396 - },
6397 - },
6398 - "edgesIn": Set {
6399 - EdgeIn {
6400 - "type": "peer",
6401 - "name": "e",
6402 - "spec": "1",
6403 - "from": "node_modules/d",
6404 - },
6405 - },
6406 - },
6407 },
6408 }
6409
6410 `
6411
6412 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, force > placements 1`] = `
6413 Array [
6414 Object {
6415 "canPlace": Symbol(REPLACE),
6416 "canPlaceSelf": Symbol(REPLACE),
6417 "checks": Map {
6418 "" => Array [
6419 Symbol(REPLACE),
6420 Symbol(REPLACE),
6421 ],
6422 },
6423 "dep": "[email protected]",
6424 "edge": "{ ROOT prod b@2 }",
6425 "placed": "node_modules/b",
6426 },
6427 ]
6428 `
6429
6430 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, force > warnings 1`] = `
6431 Array [
6432 Array [
6433 "ERESOLVE",
6434 "overriding peer dependency",
6435 Object {
6436 "code": "ERESOLVE",
6437 "current": Object {
6438 "dependents": Array [
6439 Object {
6440 "from": Object {
6441 "dependents": Array [
6442 Object {
6443 "from": Object {
6444 "dependents": Array [
6445 Object {
6446 "from": Object {
6447 "dependents": Array [
6448 Object {
6449 "from": Object {
6450 "dependents": Array [
6451 Object {
6452 "from": Object {
6453 "name": "b",
6454 "version": "1.0.0",
6455 },
6456 "name": "c",
6457 "spec": "1",
6458 "type": "peer",
6459 },
6460 ],
6461 "isWorkspace": false,
6462 "location": "node_modules/c",
6463 "name": "c",
6464 "version": "1.0.0",
6465 },
6466 "name": "d",
6467 "spec": "1",
6468 "type": "peer",
6469 },
6470 ],
6471 "isWorkspace": false,
6472 "location": "node_modules/d",
6473 "name": "d",
6474 "version": "1.0.0",
6475 },
6476 "name": "e",
6477 "spec": "1",
6478 "type": "peer",
6479 },
6480 ],
6481 "isWorkspace": false,
6482 "location": "node_modules/e",
6483 "name": "e",
6484 "version": "1.0.0",
6485 },
6486 "name": "a",
6487 "spec": "1",
6488 "type": "peer",
6489 },
6490 Object {
6491 "from": Object {
6492 "location": "/some/path",
6493 },
6494 "name": "a",
6495 "spec": "1",
6496 "type": "prod",
6497 },
6498 ],
6499 "isWorkspace": false,
6500 "location": "node_modules/a",
6501 "name": "a",
6502 "version": "1.0.0",
6503 },
6504 "name": "b",
6505 "spec": "1",
6506 "type": "peer",
6507 },
6508 Object {
6509 "error": "INVALID",
6510 "from": Object {
6511 "location": "/some/path",
6512 },
6513 "name": "b",
6514 "spec": "2",
6515 "type": "prod",
6516 },
6517 ],
6518 "isWorkspace": false,
6519 "location": "node_modules/b",
6520 "name": "b",
6521 "version": "1.0.0",
6522 },
6523 "dep": Object {
6524 "dependents": Array [
6525 Object {
6526 "error": "INVALID",
6527 "from": Object {
6528 "location": "/some/path",
6529 },
6530 "name": "b",
6531 "spec": "2",
6532 "type": "prod",
6533 },
6534 ],
6535 "isWorkspace": false,
6536 "location": "node_modules/b",
6537 "name": "b",
6538 "version": "2.0.0",
6539 "whileInstalling": Object {
6540 "name": undefined,
6541 "path": "/some/path",
6542 "version": undefined,
6543 },
6544 },
6545 "edge": Object {
6546 "from": Object {
6547 "dependents": Array [
6548 Object {
6549 "from": Object {
6550 "dependents": Array [
6551 Object {
6552 "from": Object {
6553 "dependents": Array [
6554 Object {
6555 "from": Object {
6556 "dependents": Array [
6557 Object {
6558 "from": Object {
6559 "name": "b",
6560 "version": "1.0.0",
6561 },
6562 "name": "c",
6563 "spec": "1",
6564 "type": "peer",
6565 },
6566 ],
6567 "isWorkspace": false,
6568 "location": "node_modules/c",
6569 "name": "c",
6570 "version": "1.0.0",
6571 },
6572 "name": "d",
6573 "spec": "1",
6574 "type": "peer",
6575 },
6576 ],
6577 "isWorkspace": false,
6578 "location": "node_modules/d",
6579 "name": "d",
6580 "version": "1.0.0",
6581 },
6582 "name": "e",
6583 "spec": "1",
6584 "type": "peer",
6585 },
6586 ],
6587 "isWorkspace": false,
6588 "location": "node_modules/e",
6589 "name": "e",
6590 "version": "1.0.0",
6591 },
6592 "name": "a",
6593 "spec": "1",
6594 "type": "peer",
6595 },
6596 Object {
6597 "from": Object {
6598 "location": "/some/path",
6599 },
6600 "name": "a",
6601 "spec": "1",
6602 "type": "prod",
6603 },
6604 ],
6605 "isWorkspace": false,
6606 "location": "node_modules/a",
6607 "name": "a",
6608 "version": "1.0.0",
6609 },
6610 "name": "b",
6611 "spec": "1",
6612 "type": "peer",
6613 },
6614 "force": true,
6615 "isMine": true,
6616 "strictPeerDeps": false,
6617 },
6618 ],
6619 ]
6620 `
6621
6622 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, legacyPeerDeps > changes to tree 1`] = `
6623 --- expected
6624 +++ actual
6625
6626 `
6627
6628 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, legacyPeerDeps > placements 1`] = `
6629 Array [
6630 Object {
6631 "canPlace": null,
6632 "canPlaceSelf": null,
6633 "checks": Map {},
6634 "dep": "[email protected]",
6635 "edge": "{ ROOT prod b@2 }",
6636 "placed": null,
6637 },
6638 ]
6639 `
6640
6641 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, newer, legacyPeerDeps > warnings 1`] = `
6642 Array []
6643 `
6644
6645 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older > thrown error 1`] = `
6646 Error: could not resolve {
6647 "code": "ERESOLVE",
6648 "current": Object {
6649 "dependents": Array [
6650 Object {
6651 "from": Object {
6652 "dependents": Array [
6653 Object {
6654 "from": Object {
6655 "dependents": Array [
6656 Object {
6657 "from": Object {
6658 "dependents": Array [
6659 Object {
6660 "from": Object {
6661 "dependents": Array [
6662 Object {
6663 "from": Object {
6664 "name": "b",
6665 "version": "2.0.0",
6666 },
6667 "name": "c",
6668 "spec": "2",
6669 "type": "peer",
6670 },
6671 ],
6672 "isWorkspace": false,
6673 "location": "node_modules/c",
6674 "name": "c",
6675 "version": "2.0.0",
6676 },
6677 "name": "d",
6678 "spec": "2",
6679 "type": "peer",
6680 },
6681 ],
6682 "isWorkspace": false,
6683 "location": "node_modules/d",
6684 "name": "d",
6685 "version": "2.0.0",
6686 },
6687 "name": "e",
6688 "spec": "2",
6689 "type": "peer",
6690 },
6691 ],
6692 "isWorkspace": false,
6693 "location": "node_modules/e",
6694 "name": "e",
6695 "version": "2.0.0",
6696 },
6697 "name": "a",
6698 "spec": "2",
6699 "type": "peer",
6700 },
6701 Object {
6702 "from": Object {
6703 "location": "/some/path",
6704 },
6705 "name": "a",
6706 "spec": "2",
6707 "type": "prod",
6708 },
6709 ],
6710 "isWorkspace": false,
6711 "location": "node_modules/a",
6712 "name": "a",
6713 "version": "2.0.0",
6714 },
6715 "name": "b",
6716 "spec": "2",
6717 "type": "peer",
6718 },
6719 Object {
6720 "error": "INVALID",
6721 "from": Object {
6722 "location": "/some/path",
6723 },
6724 "name": "b",
6725 "spec": "1",
6726 "type": "prod",
6727 },
6728 ],
6729 "isWorkspace": false,
6730 "location": "node_modules/b",
6731 "name": "b",
6732 "version": "2.0.0",
6733 },
6734 "dep": Object {
6735 "dependents": Array [
6736 Object {
6737 "error": "INVALID",
6738 "from": Object {
6739 "location": "/some/path",
6740 },
6741 "name": "b",
6742 "spec": "1",
6743 "type": "prod",
6744 },
6745 ],
6746 "isWorkspace": false,
6747 "location": "node_modules/b",
6748 "name": "b",
6749 "version": "1.0.0",
6750 "whileInstalling": Object {
6751 "name": undefined,
6752 "path": "/some/path",
6753 "version": undefined,
6754 },
6755 },
6756 "edge": Object {
6757 "error": "INVALID",
6758 "from": Object {
6759 "location": "/some/path",
6760 },
6761 "name": "b",
6762 "spec": "1",
6763 "type": "prod",
6764 },
6765 "force": false,
6766 "isMine": true,
6767 "name": "Error",
6768 "peerConflict": Object {
6769 "current": Object {
6770 "dependents": Array [
6771 Object {
6772 "from": Object {
6773 "name": "b",
6774 "version": "2.0.0",
6775 },
6776 "name": "c",
6777 "spec": "2",
6778 "type": "peer",
6779 },
6780 ],
6781 "isWorkspace": false,
6782 "location": "node_modules/c",
6783 "name": "c",
6784 "version": "2.0.0",
6785 },
6786 "peer": Object {
6787 "dependents": Array [
6788 Object {
6789 "from": Object {
6790 "dependents": Array [
6791 Object {
6792 "error": "INVALID",
6793 "from": Object {
6794 "location": "/some/path",
6795 },
6796 "name": "b",
6797 "spec": "1",
6798 "type": "prod",
6799 },
6800 ],
6801 "isWorkspace": false,
6802 "location": "node_modules/b",
6803 "name": "b",
6804 "version": "1.0.0",
6805 "whileInstalling": Object {
6806 "name": undefined,
6807 "path": "/some/path",
6808 "version": undefined,
6809 },
6810 },
6811 "name": "c",
6812 "spec": "1",
6813 "type": "peer",
6814 },
6815 ],
6816 "isWorkspace": false,
6817 "location": "node_modules/c",
6818 "name": "c",
6819 "version": "1.0.0",
6820 "whileInstalling": Object {
6821 "name": undefined,
6822 "path": "/some/path",
6823 "version": undefined,
6824 },
6825 },
6826 },
6827 "strictPeerDeps": false,
6828 }
6829 `
6830
6831 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > changes to tree 1`] = `
6832 --- expected
6833 +++ actual
6834 @@ -19,7 +19,6 @@
6835 "name": "b",
6836 "spec": "1",
6837 "to": "node_modules/b",
6838 - "error": "INVALID",
6839 },
6840 },
6841 "children": Map {
6842 @@ -37,6 +36,8 @@
6843 "type": "peer",
6844 "name": "b",
6845 "spec": "2",
6846 + "error": "INVALID",
6847 + "peerConflicted": true,
6848 "to": "node_modules/b",
6849 },
6850 },
6851 @@ -47,17 +48,11 @@
6852 "spec": "2",
6853 "from": "",
6854 },
6855 - EdgeIn {
6856 - "type": "peer",
6857 - "name": "a",
6858 - "spec": "2",
6859 - "from": "node_modules/e",
6860 - },
6861 },
6862 },
6863 "b" => ArboristNode {
6864 "name": "b",
6865 - "version": "2.0.0",
6866 + "version": "1.0.0",
6867 "location": "node_modules/b",
6868 "path": "/some/path/node_modules/b",
6869 "extraneous": true,
6870 @@ -68,8 +63,9 @@
6871 "c" => EdgeOut {
6872 "type": "peer",
6873 "name": "c",
6874 - "spec": "2",
6875 - "to": "node_modules/c",
6876 + "spec": "1",
6877 + "error": "MISSING",
6878 + "to": null,
6879 },
6880 },
6881 "edgesIn": Set {
6882 @@ -77,94 +73,17 @@
6883 "type": "prod",
6884 "name": "b",
6885 "spec": "1",
6886 - "error": "INVALID",
6887 "from": "",
6888 },
6889 EdgeIn {
6890 "type": "peer",
6891 "name": "b",
6892 "spec": "2",
6893 + "error": "INVALID",
6894 + "peerConflicted": true,
6895 "from": "node_modules/a",
6896 },
6897 },
6898 },
6899 - "c" => ArboristNode {
6900 - "name": "c",
6901 - "version": "2.0.0",
6902 - "location": "node_modules/c",
6903 - "path": "/some/path/node_modules/c",
6904 - "extraneous": true,
6905 - "dev": true,
6906 - "optional": true,
6907 - "peer": true,
6908 - "edgesOut": Map {
6909 - "d" => EdgeOut {
6910 - "type": "peer",
6911 - "name": "d",
6912 - "spec": "2",
6913 - "to": "node_modules/d",
6914 - },
6915 - },
6916 - "edgesIn": Set {
6917 - EdgeIn {
6918 - "type": "peer",
6919 - "name": "c",
6920 - "spec": "2",
6921 - "from": "node_modules/b",
6922 - },
6923 - },
6924 - },
6925 - "d" => ArboristNode {
6926 - "name": "d",
6927 - "version": "2.0.0",
6928 - "location": "node_modules/d",
6929 - "path": "/some/path/node_modules/d",
6930 - "extraneous": true,
6931 - "dev": true,
6932 - "optional": true,
6933 - "peer": true,
6934 - "edgesOut": Map {
6935 - "e" => EdgeOut {
6936 - "type": "peer",
6937 - "name": "e",
6938 - "spec": "2",
6939 - "to": "node_modules/e",
6940 - },
6941 - },
6942 - "edgesIn": Set {
6943 - EdgeIn {
6944 - "type": "peer",
6945 - "name": "d",
6946 - "spec": "2",
6947 - "from": "node_modules/c",
6948 - },
6949 - },
6950 - },
6951 - "e" => ArboristNode {
6952 - "name": "e",
6953 - "version": "2.0.0",
6954 - "location": "node_modules/e",
6955 - "path": "/some/path/node_modules/e",
6956 - "extraneous": true,
6957 - "dev": true,
6958 - "optional": true,
6959 - "peer": true,
6960 - "edgesOut": Map {
6961 - "a" => EdgeOut {
6962 - "type": "peer",
6963 - "name": "a",
6964 - "spec": "2",
6965 - "to": "node_modules/a",
6966 - },
6967 - },
6968 - "edgesIn": Set {
6969 - EdgeIn {
6970 - "type": "peer",
6971 - "name": "e",
6972 - "spec": "2",
6973 - "from": "node_modules/d",
6974 - },
6975 - },
6976 - },
6977 },
6978 }
6979
6980 `
6981
6982 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > changes to tree 2`] = `
6983 --- expected
6984 +++ actual
6985 @@ -19,7 +19,6 @@
6986 "name": "b",
6987 "spec": "1",
6988 "to": "node_modules/b",
6989 - "error": "INVALID",
6990 },
6991 },
6992 "children": Map {
6993 @@ -37,6 +36,8 @@
6994 "type": "peer",
6995 "name": "b",
6996 "spec": "2",
6997 + "error": "INVALID",
6998 + "peerConflicted": true,
6999 "to": "node_modules/b",
7000 },
7001 },
7002 @@ -50,14 +51,16 @@
7003 EdgeIn {
7004 "type": "peer",
7005 "name": "a",
7006 - "spec": "2",
7007 + "spec": "1",
7008 + "error": "INVALID",
7009 + "peerConflicted": true,
7010 "from": "node_modules/e",
7011 },
7012 },
7013 },
7014 "b" => ArboristNode {
7015 "name": "b",
7016 - "version": "2.0.0",
7017 + "version": "1.0.0",
7018 "location": "node_modules/b",
7019 "path": "/some/path/node_modules/b",
7020 "extraneous": true,
7021 @@ -68,7 +71,7 @@
7022 "c" => EdgeOut {
7023 "type": "peer",
7024 "name": "c",
7025 - "spec": "2",
7026 + "spec": "1",
7027 "to": "node_modules/c",
7028 },
7029 },
7030 @@ -77,20 +80,21 @@
7031 "type": "prod",
7032 "name": "b",
7033 "spec": "1",
7034 - "error": "INVALID",
7035 "from": "",
7036 },
7037 EdgeIn {
7038 "type": "peer",
7039 "name": "b",
7040 "spec": "2",
7041 + "error": "INVALID",
7042 + "peerConflicted": true,
7043 "from": "node_modules/a",
7044 },
7045 },
7046 },
7047 "c" => ArboristNode {
7048 "name": "c",
7049 - "version": "2.0.0",
7050 + "version": "1.0.0",
7051 "location": "node_modules/c",
7052 "path": "/some/path/node_modules/c",
7053 "extraneous": true,
7054 @@ -101,7 +105,7 @@
7055 "d" => EdgeOut {
7056 "type": "peer",
7057 "name": "d",
7058 - "spec": "2",
7059 + "spec": "1",
7060 "to": "node_modules/d",
7061 },
7062 },
7063 @@ -109,14 +113,14 @@
7064 EdgeIn {
7065 "type": "peer",
7066 "name": "c",
7067 - "spec": "2",
7068 + "spec": "1",
7069 "from": "node_modules/b",
7070 },
7071 },
7072 },
7073 "d" => ArboristNode {
7074 "name": "d",
7075 - "version": "2.0.0",
7076 + "version": "1.0.0",
7077 "location": "node_modules/d",
7078 "path": "/some/path/node_modules/d",
7079 "extraneous": true,
7080 @@ -127,7 +131,7 @@
7081 "e" => EdgeOut {
7082 "type": "peer",
7083 "name": "e",
7084 - "spec": "2",
7085 + "spec": "1",
7086 "to": "node_modules/e",
7087 },
7088 },
7089 @@ -135,14 +139,14 @@
7090 EdgeIn {
7091 "type": "peer",
7092 "name": "d",
7093 - "spec": "2",
7094 + "spec": "1",
7095 "from": "node_modules/c",
7096 },
7097 },
7098 },
7099 "e" => ArboristNode {
7100 "name": "e",
7101 - "version": "2.0.0",
7102 + "version": "1.0.0",
7103 "location": "node_modules/e",
7104 "path": "/some/path/node_modules/e",
7105 "extraneous": true,
7106 @@ -153,7 +157,9 @@
7107 "a" => EdgeOut {
7108 "type": "peer",
7109 "name": "a",
7110 - "spec": "2",
7111 + "spec": "1",
7112 + "error": "INVALID",
7113 + "peerConflicted": true,
7114 "to": "node_modules/a",
7115 },
7116 },
7117 @@ -161,7 +167,7 @@
7118 EdgeIn {
7119 "type": "peer",
7120 "name": "e",
7121 - "spec": "2",
7122 + "spec": "1",
7123 "from": "node_modules/d",
7124 },
7125 },
7126
7127 `
7128
7129 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > placements 1`] = `
7130 Array [
7131 Object {
7132 "canPlace": Symbol(REPLACE),
7133 "canPlaceSelf": Symbol(REPLACE),
7134 "checks": Map {
7135 "" => Array [
7136 Symbol(REPLACE),
7137 Symbol(REPLACE),
7138 ],
7139 },
7140 "dep": "[email protected]",
7141 "edge": "{ ROOT prod b@1 }",
7142 "placed": "node_modules/b",
7143 },
7144 ]
7145 `
7146
7147 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > placements 2`] = `
7148 Array [
7149 Object {
7150 "canPlace": Symbol(CONFLICT),
7151 "canPlaceSelf": Symbol(REPLACE),
7152 "checks": Map {
7153 "" => Array [
7154 Symbol(CONFLICT),
7155 Symbol(REPLACE),
7156 ],
7157 },
7158 "dep": "[email protected]",
7159 "edge": "{ ROOT prod b@1 }",
7160 "placed": "node_modules/b",
7161 },
7162 Object {
7163 "canPlace": Symbol(CONFLICT),
7164 "canPlaceSelf": Symbol(OK),
7165 "checks": Map {
7166 "" => Array [
7167 Symbol(CONFLICT),
7168 Symbol(REPLACE),
7169 ],
7170 },
7171 "dep": "[email protected]",
7172 "edge": "{ node_modules/b peer c@1 }",
7173 "parent": "b",
7174 "placed": "node_modules/c",
7175 },
7176 Object {
7177 "canPlace": Symbol(CONFLICT),
7178 "canPlaceSelf": Symbol(OK),
7179 "checks": Map {
7180 "" => Array [
7181 Symbol(CONFLICT),
7182 Symbol(REPLACE),
7183 ],
7184 },
7185 "dep": "[email protected]",
7186 "edge": "{ node_modules/c peer d@1 }",
7187 "parent": "c",
7188 "placed": "node_modules/d",
7189 },
7190 Object {
7191 "canPlace": Symbol(CONFLICT),
7192 "canPlaceSelf": Symbol(OK),
7193 "checks": Map {
7194 "" => Array [
7195 Symbol(CONFLICT),
7196 Symbol(REPLACE),
7197 ],
7198 },
7199 "dep": "[email protected]",
7200 "edge": "{ node_modules/d peer e@1 }",
7201 "parent": "d",
7202 "placed": "node_modules/e",
7203 },
7204 Object {
7205 "canPlace": null,
7206 "canPlaceSelf": null,
7207 "checks": Map {
7208 "" => Array [
7209 Symbol(CONFLICT),
7210 Symbol(REPLACE),
7211 ],
7212 },
7213 "dep": "[email protected]",
7214 "edge": "{ node_modules/e peer a@1 }",
7215 "parent": "e",
7216 "placed": null,
7217 },
7218 ]
7219 `
7220
7221 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > warnings 1`] = `
7222 Array [
7223 Array [
7224 "ERESOLVE",
7225 "overriding peer dependency",
7226 Object {
7227 "code": "ERESOLVE",
7228 "current": Object {
7229 "dependents": Array [
7230 Object {
7231 "from": Object {
7232 "dependents": Array [
7233 Object {
7234 "from": Object {
7235 "dependents": Array [
7236 Object {
7237 "from": Object {
7238 "dependents": Array [
7239 Object {
7240 "from": Object {
7241 "dependents": Array [
7242 Object {
7243 "from": Object {
7244 "name": "b",
7245 "version": "2.0.0",
7246 },
7247 "name": "c",
7248 "spec": "2",
7249 "type": "peer",
7250 },
7251 ],
7252 "isWorkspace": false,
7253 "location": "node_modules/c",
7254 "name": "c",
7255 "version": "2.0.0",
7256 },
7257 "name": "d",
7258 "spec": "2",
7259 "type": "peer",
7260 },
7261 ],
7262 "isWorkspace": false,
7263 "location": "node_modules/d",
7264 "name": "d",
7265 "version": "2.0.0",
7266 },
7267 "name": "e",
7268 "spec": "2",
7269 "type": "peer",
7270 },
7271 ],
7272 "isWorkspace": false,
7273 "location": "node_modules/e",
7274 "name": "e",
7275 "version": "2.0.0",
7276 },
7277 "name": "a",
7278 "spec": "2",
7279 "type": "peer",
7280 },
7281 Object {
7282 "from": Object {
7283 "location": "/some/path",
7284 },
7285 "name": "a",
7286 "spec": "2",
7287 "type": "prod",
7288 },
7289 ],
7290 "isWorkspace": false,
7291 "location": "node_modules/a",
7292 "name": "a",
7293 "version": "2.0.0",
7294 },
7295 "name": "b",
7296 "spec": "2",
7297 "type": "peer",
7298 },
7299 Object {
7300 "error": "INVALID",
7301 "from": Object {
7302 "location": "/some/path",
7303 },
7304 "name": "b",
7305 "spec": "1",
7306 "type": "prod",
7307 },
7308 ],
7309 "isWorkspace": false,
7310 "location": "node_modules/b",
7311 "name": "b",
7312 "version": "2.0.0",
7313 },
7314 "dep": Object {
7315 "dependents": Array [
7316 Object {
7317 "error": "INVALID",
7318 "from": Object {
7319 "location": "/some/path",
7320 },
7321 "name": "b",
7322 "spec": "1",
7323 "type": "prod",
7324 },
7325 ],
7326 "isWorkspace": false,
7327 "location": "node_modules/b",
7328 "name": "b",
7329 "version": "1.0.0",
7330 "whileInstalling": Object {
7331 "name": undefined,
7332 "path": "/some/path",
7333 "version": undefined,
7334 },
7335 },
7336 "edge": Object {
7337 "from": Object {
7338 "dependents": Array [
7339 Object {
7340 "from": Object {
7341 "dependents": Array [
7342 Object {
7343 "from": Object {
7344 "dependents": Array [
7345 Object {
7346 "from": Object {
7347 "dependents": Array [
7348 Object {
7349 "from": Object {
7350 "name": "b",
7351 "version": "2.0.0",
7352 },
7353 "name": "c",
7354 "spec": "2",
7355 "type": "peer",
7356 },
7357 ],
7358 "isWorkspace": false,
7359 "location": "node_modules/c",
7360 "name": "c",
7361 "version": "2.0.0",
7362 },
7363 "name": "d",
7364 "spec": "2",
7365 "type": "peer",
7366 },
7367 ],
7368 "isWorkspace": false,
7369 "location": "node_modules/d",
7370 "name": "d",
7371 "version": "2.0.0",
7372 },
7373 "name": "e",
7374 "spec": "2",
7375 "type": "peer",
7376 },
7377 ],
7378 "isWorkspace": false,
7379 "location": "node_modules/e",
7380 "name": "e",
7381 "version": "2.0.0",
7382 },
7383 "name": "a",
7384 "spec": "2",
7385 "type": "peer",
7386 },
7387 Object {
7388 "from": Object {
7389 "location": "/some/path",
7390 },
7391 "name": "a",
7392 "spec": "2",
7393 "type": "prod",
7394 },
7395 ],
7396 "isWorkspace": false,
7397 "location": "node_modules/a",
7398 "name": "a",
7399 "version": "2.0.0",
7400 },
7401 "name": "b",
7402 "spec": "2",
7403 "type": "peer",
7404 },
7405 "force": true,
7406 "isMine": true,
7407 "strictPeerDeps": false,
7408 },
7409 ],
7410 ]
7411 `
7412
7413 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, force > warnings 2`] = `
7414 Array [
7415 Array [
7416 "ERESOLVE",
7417 "overriding peer dependency",
7418 Object {
7419 "code": "ERESOLVE",
7420 "current": Object {
7421 "dependents": Array [
7422 Object {
7423 "from": Object {
7424 "name": "a",
7425 "version": "2.0.0",
7426 },
7427 "name": "b",
7428 "spec": "2",
7429 "type": "peer",
7430 },
7431 Object {
7432 "error": "INVALID",
7433 "from": Object {
7434 "location": "/some/path",
7435 },
7436 "name": "b",
7437 "spec": "1",
7438 "type": "prod",
7439 },
7440 ],
7441 "isWorkspace": false,
7442 "location": "node_modules/b",
7443 "name": "b",
7444 "version": "2.0.0",
7445 },
7446 "dep": Object {
7447 "dependents": Array [
7448 Object {
7449 "from": Object {
7450 "dependents": Array [
7451 Object {
7452 "from": Object {
7453 "dependents": Array [
7454 Object {
7455 "from": Object {
7456 "dependents": Array [
7457 Object {
7458 "from": Object {
7459 "dependents": Array [
7460 Object {
7461 "from": Object {
7462 "dependents": Array [
7463 Object {
7464 "from": Object {
7465 "name": "a",
7466 "version": "2.0.0",
7467 },
7468 "name": "b",
7469 "spec": "2",
7470 "type": "peer",
7471 },
7472 Object {
7473 "error": "INVALID",
7474 "from": Object {
7475 "location": "/some/path",
7476 },
7477 "name": "b",
7478 "spec": "1",
7479 "type": "prod",
7480 },
7481 ],
7482 "isWorkspace": false,
7483 "location": "node_modules/b",
7484 "name": "b",
7485 "version": "2.0.0",
7486 },
7487 "name": "c",
7488 "spec": "2",
7489 "type": "peer",
7490 },
7491 ],
7492 "isWorkspace": false,
7493 "location": "node_modules/c",
7494 "name": "c",
7495 "version": "2.0.0",
7496 },
7497 "name": "d",
7498 "spec": "2",
7499 "type": "peer",
7500 },
7501 ],
7502 "isWorkspace": false,
7503 "location": "node_modules/d",
7504 "name": "d",
7505 "version": "2.0.0",
7506 },
7507 "name": "e",
7508 "spec": "2",
7509 "type": "peer",
7510 },
7511 ],
7512 "isWorkspace": false,
7513 "location": "node_modules/e",
7514 "name": "e",
7515 "version": "2.0.0",
7516 },
7517 "name": "a",
7518 "spec": "2",
7519 "type": "peer",
7520 },
7521 Object {
7522 "from": Object {
7523 "location": "/some/path",
7524 },
7525 "name": "a",
7526 "spec": "2",
7527 "type": "prod",
7528 },
7529 ],
7530 "isWorkspace": false,
7531 "location": "node_modules/a",
7532 "name": "a",
7533 "version": "2.0.0",
7534 },
7535 "name": "b",
7536 "spec": "2",
7537 "type": "peer",
7538 },
7539 ],
7540 "isWorkspace": false,
7541 "location": "node_modules/b",
7542 "name": "b",
7543 "version": "1.0.0",
7544 "whileInstalling": Object {
7545 "name": undefined,
7546 "path": "/some/path",
7547 "version": undefined,
7548 },
7549 },
7550 "edge": Object {
7551 "from": Object {
7552 "dependents": Array [
7553 Object {
7554 "from": Object {
7555 "dependents": Array [
7556 Object {
7557 "from": Object {
7558 "dependents": Array [
7559 Object {
7560 "from": Object {
7561 "dependents": Array [
7562 Object {
7563 "from": Object {
7564 "dependents": Array [
7565 Object {
7566 "from": Object {
7567 "name": "a",
7568 "version": "2.0.0",
7569 },
7570 "name": "b",
7571 "spec": "2",
7572 "type": "peer",
7573 },
7574 Object {
7575 "error": "INVALID",
7576 "from": Object {
7577 "location": "/some/path",
7578 },
7579 "name": "b",
7580 "spec": "1",
7581 "type": "prod",
7582 },
7583 ],
7584 "isWorkspace": false,
7585 "location": "node_modules/b",
7586 "name": "b",
7587 "version": "2.0.0",
7588 },
7589 "name": "c",
7590 "spec": "2",
7591 "type": "peer",
7592 },
7593 ],
7594 "isWorkspace": false,
7595 "location": "node_modules/c",
7596 "name": "c",
7597 "version": "2.0.0",
7598 },
7599 "name": "d",
7600 "spec": "2",
7601 "type": "peer",
7602 },
7603 ],
7604 "isWorkspace": false,
7605 "location": "node_modules/d",
7606 "name": "d",
7607 "version": "2.0.0",
7608 },
7609 "name": "e",
7610 "spec": "2",
7611 "type": "peer",
7612 },
7613 ],
7614 "isWorkspace": false,
7615 "location": "node_modules/e",
7616 "name": "e",
7617 "version": "2.0.0",
7618 },
7619 "name": "a",
7620 "spec": "2",
7621 "type": "peer",
7622 },
7623 Object {
7624 "from": Object {
7625 "location": "/some/path",
7626 },
7627 "name": "a",
7628 "spec": "2",
7629 "type": "prod",
7630 },
7631 ],
7632 "isWorkspace": false,
7633 "location": "node_modules/a",
7634 "name": "a",
7635 "version": "2.0.0",
7636 },
7637 "name": "b",
7638 "spec": "2",
7639 "type": "peer",
7640 },
7641 "force": true,
7642 "isMine": true,
7643 "peerConflict": Object {
7644 "current": Object {
7645 "dependents": Array [
7646 Object {
7647 "from": Object {
7648 "dependents": Array [
7649 Object {
7650 "from": Object {
7651 "name": "a",
7652 "version": "2.0.0",
7653 },
7654 "name": "b",
7655 "spec": "2",
7656 "type": "peer",
7657 },
7658 Object {
7659 "error": "INVALID",
7660 "from": Object {
7661 "location": "/some/path",
7662 },
7663 "name": "b",
7664 "spec": "1",
7665 "type": "prod",
7666 },
7667 ],
7668 "isWorkspace": false,
7669 "location": "node_modules/b",
7670 "name": "b",
7671 "version": "2.0.0",
7672 },
7673 "name": "c",
7674 "spec": "2",
7675 "type": "peer",
7676 },
7677 ],
7678 "isWorkspace": false,
7679 "location": "node_modules/c",
7680 "name": "c",
7681 "version": "2.0.0",
7682 },
7683 "peer": Object {
7684 "dependents": Array [
7685 Object {
7686 "from": Object {
7687 "dependents": Array [
7688 Object {
7689 "from": Object {
7690 "dependents": Array [
7691 Object {
7692 "from": Object {
7693 "dependents": Array [
7694 Object {
7695 "from": Object {
7696 "dependents": Array [
7697 Object {
7698 "from": Object {
7699 "dependents": Array [
7700 Object {
7701 "from": Object {
7702 "dependents": Array [
7703 Object {
7704 "from": Object {
7705 "name": "a",
7706 "version": "2.0.0",
7707 },
7708 "name": "b",
7709 "spec": "2",
7710 "type": "peer",
7711 },
7712 Object {
7713 "error": "INVALID",
7714 "from": Object {
7715 "location": "/some/path",
7716 },
7717 "name": "b",
7718 "spec": "1",
7719 "type": "prod",
7720 },
7721 ],
7722 "isWorkspace": false,
7723 "location": "node_modules/b",
7724 "name": "b",
7725 "version": "2.0.0",
7726 },
7727 "name": "c",
7728 "spec": "2",
7729 "type": "peer",
7730 },
7731 ],
7732 "isWorkspace": false,
7733 "location": "node_modules/c",
7734 "name": "c",
7735 "version": "2.0.0",
7736 },
7737 "name": "d",
7738 "spec": "2",
7739 "type": "peer",
7740 },
7741 ],
7742 "isWorkspace": false,
7743 "location": "node_modules/d",
7744 "name": "d",
7745 "version": "2.0.0",
7746 },
7747 "name": "e",
7748 "spec": "2",
7749 "type": "peer",
7750 },
7751 ],
7752 "isWorkspace": false,
7753 "location": "node_modules/e",
7754 "name": "e",
7755 "version": "2.0.0",
7756 },
7757 "name": "a",
7758 "spec": "2",
7759 "type": "peer",
7760 },
7761 Object {
7762 "from": Object {
7763 "location": "/some/path",
7764 },
7765 "name": "a",
7766 "spec": "2",
7767 "type": "prod",
7768 },
7769 ],
7770 "isWorkspace": false,
7771 "location": "node_modules/a",
7772 "name": "a",
7773 "version": "2.0.0",
7774 },
7775 "name": "b",
7776 "spec": "2",
7777 "type": "peer",
7778 },
7779 ],
7780 "isWorkspace": false,
7781 "location": "node_modules/b",
7782 "name": "b",
7783 "version": "1.0.0",
7784 "whileInstalling": Object {
7785 "name": undefined,
7786 "path": "/some/path",
7787 "version": undefined,
7788 },
7789 },
7790 "name": "c",
7791 "spec": "1",
7792 "type": "peer",
7793 },
7794 ],
7795 "isWorkspace": false,
7796 "location": "node_modules/c",
7797 "name": "c",
7798 "version": "1.0.0",
7799 "whileInstalling": Object {
7800 "name": undefined,
7801 "path": "/some/path",
7802 "version": undefined,
7803 },
7804 },
7805 },
7806 "strictPeerDeps": false,
7807 },
7808 ],
7809 Array [
7810 "ERESOLVE",
7811 "overriding peer dependency",
7812 Object {
7813 "code": "ERESOLVE",
7814 "current": Object {
7815 "dependents": Array [
7816 Object {
7817 "from": Object {
7818 "dependents": Array [
7819 Object {
7820 "from": Object {
7821 "dependents": Array [
7822 Object {
7823 "from": Object {
7824 "dependents": Array [
7825 Object {
7826 "from": Object {
7827 "dependents": Array [
7828 Object {
7829 "from": Object {
7830 "name": "a",
7831 "version": "2.0.0",
7832 },
7833 "name": "b",
7834 "spec": "2",
7835 "type": "peer",
7836 },
7837 Object {
7838 "error": "INVALID",
7839 "from": Object {
7840 "location": "/some/path",
7841 },
7842 "name": "b",
7843 "spec": "1",
7844 "type": "prod",
7845 },
7846 ],
7847 "isWorkspace": false,
7848 "location": "node_modules/b",
7849 "name": "b",
7850 "version": "2.0.0",
7851 },
7852 "name": "c",
7853 "spec": "2",
7854 "type": "peer",
7855 },
7856 ],
7857 "isWorkspace": false,
7858 "location": "node_modules/c",
7859 "name": "c",
7860 "version": "2.0.0",
7861 },
7862 "name": "d",
7863 "spec": "2",
7864 "type": "peer",
7865 },
7866 ],
7867 "isWorkspace": false,
7868 "location": "node_modules/d",
7869 "name": "d",
7870 "version": "2.0.0",
7871 },
7872 "name": "e",
7873 "spec": "2",
7874 "type": "peer",
7875 },
7876 ],
7877 "isWorkspace": false,
7878 "location": "node_modules/e",
7879 "name": "e",
7880 "version": "2.0.0",
7881 },
7882 "name": "a",
7883 "spec": "2",
7884 "type": "peer",
7885 },
7886 Object {
7887 "from": Object {
7888 "location": "/some/path",
7889 },
7890 "name": "a",
7891 "spec": "2",
7892 "type": "prod",
7893 },
7894 ],
7895 "isWorkspace": false,
7896 "location": "node_modules/a",
7897 "name": "a",
7898 "version": "2.0.0",
7899 },
7900 "dep": Object {
7901 "dependents": Array [
7902 Object {
7903 "error": "INVALID",
7904 "from": Object {
7905 "dependents": Array [
7906 Object {
7907 "from": Object {
7908 "dependents": Array [
7909 Object {
7910 "from": Object {
7911 "dependents": Array [
7912 Object {
7913 "from": Object {
7914 "dependents": Array [
7915 Object {
7916 "from": Object {
7917 "location": "/some/path",
7918 },
7919 "name": "b",
7920 "spec": "1",
7921 "type": "prod",
7922 },
7923 ],
7924 "isWorkspace": false,
7925 "location": "node_modules/b",
7926 "name": "b",
7927 "version": "1.0.0",
7928 },
7929 "name": "c",
7930 "spec": "1",
7931 "type": "peer",
7932 },
7933 ],
7934 "isWorkspace": false,
7935 "location": "node_modules/c",
7936 "name": "c",
7937 "version": "1.0.0",
7938 },
7939 "name": "d",
7940 "spec": "1",
7941 "type": "peer",
7942 },
7943 ],
7944 "isWorkspace": false,
7945 "location": "node_modules/d",
7946 "name": "d",
7947 "version": "1.0.0",
7948 },
7949 "name": "e",
7950 "spec": "1",
7951 "type": "peer",
7952 },
7953 ],
7954 "isWorkspace": false,
7955 "location": "node_modules/e",
7956 "name": "e",
7957 "version": "1.0.0",
7958 },
7959 "name": "a",
7960 "spec": "1",
7961 "type": "peer",
7962 },
7963 ],
7964 "isWorkspace": false,
7965 "location": "node_modules/a",
7966 "name": "a",
7967 "version": "1.0.0",
7968 "whileInstalling": Object {
7969 "name": undefined,
7970 "path": "/some/path",
7971 "version": undefined,
7972 },
7973 },
7974 "edge": Object {
7975 "error": "INVALID",
7976 "from": Object {
7977 "dependents": Array [
7978 Object {
7979 "from": Object {
7980 "dependents": Array [
7981 Object {
7982 "from": Object {
7983 "dependents": Array [
7984 Object {
7985 "from": Object {
7986 "dependents": Array [
7987 Object {
7988 "from": Object {
7989 "location": "/some/path",
7990 },
7991 "name": "b",
7992 "spec": "1",
7993 "type": "prod",
7994 },
7995 ],
7996 "isWorkspace": false,
7997 "location": "node_modules/b",
7998 "name": "b",
7999 "version": "1.0.0",
8000 },
8001 "name": "c",
8002 "spec": "1",
8003 "type": "peer",
8004 },
8005 ],
8006 "isWorkspace": false,
8007 "location": "node_modules/c",
8008 "name": "c",
8009 "version": "1.0.0",
8010 },
8011 "name": "d",
8012 "spec": "1",
8013 "type": "peer",
8014 },
8015 ],
8016 "isWorkspace": false,
8017 "location": "node_modules/d",
8018 "name": "d",
8019 "version": "1.0.0",
8020 },
8021 "name": "e",
8022 "spec": "1",
8023 "type": "peer",
8024 },
8025 ],
8026 "isWorkspace": false,
8027 "location": "node_modules/e",
8028 "name": "e",
8029 "version": "1.0.0",
8030 },
8031 "name": "a",
8032 "spec": "1",
8033 "type": "peer",
8034 },
8035 "force": true,
8036 "isMine": true,
8037 "peerConflict": Object {
8038 "dependents": Array [
8039 Object {
8040 "from": Object {
8041 "dependents": Array [
8042 Object {
8043 "from": Object {
8044 "dependents": Array [
8045 Object {
8046 "from": Object {
8047 "dependents": Array [
8048 Object {
8049 "from": Object {
8050 "dependents": Array [
8051 Object {
8052 "from": Object {
8053 "name": "a",
8054 "version": "2.0.0",
8055 },
8056 "name": "b",
8057 "spec": "2",
8058 "type": "peer",
8059 },
8060 Object {
8061 "error": "INVALID",
8062 "from": Object {
8063 "location": "/some/path",
8064 },
8065 "name": "b",
8066 "spec": "1",
8067 "type": "prod",
8068 },
8069 ],
8070 "isWorkspace": false,
8071 "location": "node_modules/b",
8072 "name": "b",
8073 "version": "2.0.0",
8074 },
8075 "name": "c",
8076 "spec": "2",
8077 "type": "peer",
8078 },
8079 ],
8080 "isWorkspace": false,
8081 "location": "node_modules/c",
8082 "name": "c",
8083 "version": "2.0.0",
8084 },
8085 "name": "d",
8086 "spec": "2",
8087 "type": "peer",
8088 },
8089 ],
8090 "isWorkspace": false,
8091 "location": "node_modules/d",
8092 "name": "d",
8093 "version": "2.0.0",
8094 },
8095 "name": "e",
8096 "spec": "2",
8097 "type": "peer",
8098 },
8099 ],
8100 "isWorkspace": false,
8101 "location": "node_modules/e",
8102 "name": "e",
8103 "version": "2.0.0",
8104 },
8105 "name": "a",
8106 "spec": "2",
8107 "type": "peer",
8108 },
8109 Object {
8110 "from": Object {
8111 "location": "/some/path",
8112 },
8113 "name": "a",
8114 "spec": "2",
8115 "type": "prod",
8116 },
8117 ],
8118 "isWorkspace": false,
8119 "location": "node_modules/a",
8120 "name": "a",
8121 "version": "2.0.0",
8122 },
8123 "strictPeerDeps": false,
8124 },
8125 ],
8126 ]
8127 `
8128
8129 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, legacyPeerDeps > changes to tree 1`] = `
8130 --- expected
8131 +++ actual
8132
8133 `
8134
8135 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, legacyPeerDeps > placements 1`] = `
8136 Array [
8137 Object {
8138 "canPlace": null,
8139 "canPlaceSelf": null,
8140 "checks": Map {},
8141 "dep": "[email protected]",
8142 "edge": "{ ROOT prod b@1 }",
8143 "placed": null,
8144 },
8145 ]
8146 `
8147
8148 exports[`test/place-dep.js TAP placement tests prod dep directly on conflicted peer, older, legacyPeerDeps > warnings 1`] = `
8149 Array []
8150 `
8151
8152 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 1 > changes to tree 1`] = `
8153 --- expected
8154 +++ actual
8155 @@ -42,8 +42,7 @@
8156 "type": "prod",
8157 "name": "y",
8158 "spec": "*",
8159 - "to": null,
8160 - "error": "MISSING",
8161 + "to": "node_modules/a/node_modules/y",
8162 },
8163 },
8164 "edgesIn": Set {
8165 @@ -54,6 +53,36 @@
8166 "from": "",
8167 },
8168 },
8169 + "children": Map {
8170 + "y" => ArboristNode {
8171 + "name": "y",
8172 + "version": "1.0.0",
8173 + "location": "node_modules/a/node_modules/y",
8174 + "path": "/some/path/node_modules/a/node_modules/y",
8175 + "extraneous": true,
8176 + "dev": true,
8177 + "optional": true,
8178 + "peer": true,
8179 + "edgesOut": Map {
8180 + "j" => EdgeOut {
8181 + "type": "peer",
8182 + "name": "j",
8183 + "spec": "2",
8184 + "error": "INVALID",
8185 + "peerConflicted": true,
8186 + "to": "node_modules/j",
8187 + },
8188 + },
8189 + "edgesIn": Set {
8190 + EdgeIn {
8191 + "type": "prod",
8192 + "name": "y",
8193 + "spec": "*",
8194 + "from": "node_modules/a",
8195 + },
8196 + },
8197 + },
8198 + },
8199 },
8200 "j" => ArboristNode {
8201 "name": "j",
8202 @@ -74,6 +103,14 @@
8203 EdgeIn {
8204 "type": "peer",
8205 "name": "j",
8206 + "spec": "2",
8207 + "error": "INVALID",
8208 + "peerConflicted": true,
8209 + "from": "node_modules/a/node_modules/y",
8210 + },
8211 + EdgeIn {
8212 + "type": "peer",
8213 + "name": "j",
8214 "spec": "1",
8215 "from": "node_modules/x",
8216 },
8217
8218 `
8219
8220 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 1 > placements 1`] = `
8221 Array [
8222 Object {
8223 "canPlace": Symbol(CONFLICT),
8224 "canPlaceSelf": Symbol(OK),
8225 "checks": Map {
8226 "node_modules/a" => Array [
8227 Symbol(CONFLICT),
8228 Symbol(OK),
8229 ],
8230 },
8231 "dep": "[email protected]",
8232 "edge": "{ node_modules/a prod y@ }",
8233 "placed": "node_modules/a/node_modules/y",
8234 },
8235 Object {
8236 "canPlace": null,
8237 "canPlaceSelf": null,
8238 "checks": Map {
8239 "node_modules/a" => Array [
8240 Symbol(CONFLICT),
8241 Symbol(OK),
8242 ],
8243 },
8244 "dep": "[email protected]",
8245 "edge": "{ node_modules/a/node_modules/y peer j@2 }",
8246 "parent": "y",
8247 "placed": null,
8248 },
8249 ]
8250 `
8251
8252 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 1 > warnings 1`] = `
8253 Array [
8254 Array [
8255 "ERESOLVE",
8256 "overriding peer dependency",
8257 Object {
8258 "code": "ERESOLVE",
8259 "current": Object {
8260 "dependents": Array [
8261 Object {
8262 "error": "INVALID",
8263 "from": Object {
8264 "dependents": Array [
8265 Object {
8266 "from": Object {
8267 "dependents": Array [
8268 Object {
8269 "from": Object {
8270 "location": "/some/path",
8271 },
8272 "name": "a",
8273 "spec": "",
8274 "type": "prod",
8275 },
8276 ],
8277 "isWorkspace": false,
8278 "location": "node_modules/a",
8279 "name": "a",
8280 "version": "1.0.0",
8281 },
8282 "name": "y",
8283 "spec": "",
8284 "type": "prod",
8285 },
8286 ],
8287 "isWorkspace": false,
8288 "location": "node_modules/a/node_modules/y",
8289 "name": "y",
8290 "version": "1.0.0",
8291 },
8292 "name": "j",
8293 "spec": "2",
8294 "type": "peer",
8295 },
8296 ],
8297 "isWorkspace": false,
8298 "location": "node_modules/j",
8299 "name": "j",
8300 "version": "1.0.0",
8301 },
8302 "dep": Object {
8303 "dependents": Array [
8304 Object {
8305 "error": "INVALID",
8306 "from": Object {
8307 "dependents": Array [
8308 Object {
8309 "from": Object {
8310 "dependents": Array [
8311 Object {
8312 "from": Object {
8313 "location": "/some/path",
8314 },
8315 "name": "a",
8316 "spec": "",
8317 "type": "prod",
8318 },
8319 ],
8320 "isWorkspace": false,
8321 "location": "node_modules/a",
8322 "name": "a",
8323 "version": "1.0.0",
8324 },
8325 "name": "y",
8326 "spec": "",
8327 "type": "prod",
8328 },
8329 ],
8330 "isWorkspace": false,
8331 "location": "node_modules/a/node_modules/y",
8332 "name": "y",
8333 "version": "1.0.0",
8334 },
8335 "name": "j",
8336 "spec": "2",
8337 "type": "peer",
8338 },
8339 ],
8340 "isWorkspace": false,
8341 "location": "node_modules/j",
8342 "name": "j",
8343 "version": "2.0.0",
8344 "whileInstalling": Object {
8345 "name": "a",
8346 "path": "/some/path/node_modules/a",
8347 "version": "1.0.0",
8348 },
8349 },
8350 "edge": Object {
8351 "error": "INVALID",
8352 "from": Object {
8353 "dependents": Array [
8354 Object {
8355 "from": Object {
8356 "dependents": Array [
8357 Object {
8358 "from": Object {
8359 "location": "/some/path",
8360 },
8361 "name": "a",
8362 "spec": "",
8363 "type": "prod",
8364 },
8365 ],
8366 "isWorkspace": false,
8367 "location": "node_modules/a",
8368 "name": "a",
8369 "version": "1.0.0",
8370 },
8371 "name": "y",
8372 "spec": "",
8373 "type": "prod",
8374 },
8375 ],
8376 "isWorkspace": false,
8377 "location": "node_modules/a/node_modules/y",
8378 "name": "y",
8379 "version": "1.0.0",
8380 },
8381 "name": "j",
8382 "spec": "2",
8383 "type": "peer",
8384 },
8385 "force": false,
8386 "isMine": false,
8387 "peerConflict": Object {
8388 "dependents": Array [
8389 Object {
8390 "error": "INVALID",
8391 "from": Object {
8392 "dependents": Array [
8393 Object {
8394 "from": Object {
8395 "dependents": Array [
8396 Object {
8397 "from": Object {
8398 "location": "/some/path",
8399 },
8400 "name": "a",
8401 "spec": "",
8402 "type": "prod",
8403 },
8404 ],
8405 "isWorkspace": false,
8406 "location": "node_modules/a",
8407 "name": "a",
8408 "version": "1.0.0",
8409 },
8410 "name": "y",
8411 "spec": "",
8412 "type": "prod",
8413 },
8414 ],
8415 "isWorkspace": false,
8416 "location": "node_modules/a/node_modules/y",
8417 "name": "y",
8418 "version": "1.0.0",
8419 },
8420 "name": "j",
8421 "spec": "2",
8422 "type": "peer",
8423 },
8424 ],
8425 "isWorkspace": false,
8426 "location": "node_modules/j",
8427 "name": "j",
8428 "version": "1.0.0",
8429 },
8430 "strictPeerDeps": false,
8431 },
8432 ],
8433 ]
8434 `
8435
8436 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 2 > changes to tree 1`] = `
8437 --- expected
8438 +++ actual
8439 @@ -30,13 +30,15 @@
8440 "type": "prod",
8441 "name": "j",
8442 "spec": "1",
8443 + "error": "INVALID",
8444 "to": "node_modules/j",
8445 },
8446 "x" => EdgeOut {
8447 "type": "prod",
8448 "name": "x",
8449 "spec": "*",
8450 - "to": "node_modules/x",
8451 + "error": "MISSING",
8452 + "to": null,
8453 },
8454 "y" => EdgeOut {
8455 "type": "prod",
8456 @@ -56,7 +58,7 @@
8457 },
8458 "j" => ArboristNode {
8459 "name": "j",
8460 - "version": "1.0.0",
8461 + "version": "2.0.0",
8462 "location": "node_modules/j",
8463 "path": "/some/path/node_modules/j",
8464 "extraneous": true,
8465 @@ -68,19 +70,13 @@
8466 "type": "prod",
8467 "name": "j",
8468 "spec": "1",
8469 + "error": "INVALID",
8470 "from": "node_modules/a",
8471 },
8472 EdgeIn {
8473 "type": "peer",
8474 "name": "j",
8475 - "spec": "1",
8476 - "from": "node_modules/x",
8477 - },
8478 - EdgeIn {
8479 - "type": "peer",
8480 - "name": "j",
8481 "spec": "2",
8482 - "error": "INVALID",
8483 "from": "node_modules/y",
8484 },
8485 },
8486 @@ -100,7 +96,6 @@
8487 "name": "j",
8488 "spec": "2",
8489 "to": "node_modules/j",
8490 - "error": "INVALID",
8491 },
8492 },
8493 "edgesIn": Set {
8494 @@ -112,31 +107,5 @@
8495 },
8496 },
8497 },
8498 - "x" => ArboristNode {
8499 - "name": "x",
8500 - "version": "1.0.0",
8501 - "location": "node_modules/x",
8502 - "path": "/some/path/node_modules/x",
8503 - "extraneous": true,
8504 - "dev": true,
8505 - "optional": true,
8506 - "peer": true,
8507 - "edgesOut": Map {
8508 - "j" => EdgeOut {
8509 - "type": "peer",
8510 - "name": "j",
8511 - "spec": "1",
8512 - "to": "node_modules/j",
8513 - },
8514 - },
8515 - "edgesIn": Set {
8516 - EdgeIn {
8517 - "type": "prod",
8518 - "name": "x",
8519 - "spec": "*",
8520 - "from": "node_modules/a",
8521 - },
8522 - },
8523 - },
8524 },
8525 }
8526
8527 `
8528
8529 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 2 > must match snapshot 1`] = `
8530 Array [
8531 "node_modules/a 1.0.0",
8532 ]
8533 `
8534
8535 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 2 > placements 1`] = `
8536 Array [
8537 Object {
8538 "canPlace": Symbol(REPLACE),
8539 "canPlaceSelf": Symbol(REPLACE),
8540 "checks": Map {
8541 "" => Array [
8542 Symbol(REPLACE),
8543 Symbol(REPLACE),
8544 ],
8545 },
8546 "dep": "[email protected]",
8547 "edge": "{ node_modules/y peer j@2 }",
8548 "placed": "node_modules/j",
8549 },
8550 ]
8551 `
8552
8553 exports[`test/place-dep.js TAP placement tests prune competing peerSet that can be nested, 2 > warnings 1`] = `
8554 Array []
8555 `
8556
8557 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > changes to tree 1`] = `
8558 --- expected
8559 +++ actual
8560 @@ -47,55 +47,9 @@
8561 "type": "prod",
8562 "name": "y",
8563 "spec": "1.2",
8564 - "to": "k/node_modules/y",
8565 + "to": "node_modules/y",
8566 },
8567 },
8568 - "children": Map {
8569 - "y" => ArboristNode {
8570 - "name": "y",
8571 - "version": "1.2.0",
8572 - "location": "k/node_modules/y",
8573 - "path": "/some/path/k/node_modules/y",
8574 - "extraneous": true,
8575 - "dev": true,
8576 - "optional": true,
8577 - "peer": true,
8578 - "edgesOut": Map {
8579 - "z" => EdgeOut {
8580 - "type": "prod",
8581 - "name": "z",
8582 - "spec": "1",
8583 - "to": "k/node_modules/z",
8584 - },
8585 - },
8586 - "edgesIn": Set {
8587 - EdgeIn {
8588 - "type": "prod",
8589 - "name": "y",
8590 - "spec": "1.2",
8591 - "from": "k",
8592 - },
8593 - },
8594 - },
8595 - "z" => ArboristNode {
8596 - "name": "z",
8597 - "version": "1.0.0",
8598 - "location": "k/node_modules/z",
8599 - "path": "/some/path/k/node_modules/z",
8600 - "extraneous": true,
8601 - "dev": true,
8602 - "optional": true,
8603 - "peer": true,
8604 - "edgesIn": Set {
8605 - EdgeIn {
8606 - "type": "prod",
8607 - "name": "z",
8608 - "spec": "1",
8609 - "from": "k/node_modules/y",
8610 - },
8611 - },
8612 - },
8613 - },
8614 },
8615 },
8616 "children": Map {
8617 @@ -212,7 +166,7 @@
8618 "type": "prod",
8619 "name": "y",
8620 "spec": "1.2",
8621 - "to": "node_modules/x/node_modules/y",
8622 + "to": "node_modules/y",
8623 },
8624 "z" => EdgeOut {
8625 "type": "prod",
8626 @@ -229,58 +183,10 @@
8627 "from": "",
8628 },
8629 },
8630 - "children": Map {
8631 - "y" => ArboristNode {
8632 - "name": "y",
8633 - "version": "1.2.0",
8634 - "location": "node_modules/x/node_modules/y",
8635 - "path": "/some/path/node_modules/x/node_modules/y",
8636 - "extraneous": true,
8637 - "dev": true,
8638 - "optional": true,
8639 - "peer": true,
8640 - "edgesOut": Map {
8641 - "z" => EdgeOut {
8642 - "type": "prod",
8643 - "name": "z",
8644 - "spec": "1",
8645 - "to": "node_modules/x/node_modules/y/node_modules/z",
8646 - },
8647 - },
8648 - "edgesIn": Set {
8649 - EdgeIn {
8650 - "type": "prod",
8651 - "name": "y",
8652 - "spec": "1.2",
8653 - "from": "node_modules/x",
8654 - },
8655 - },
8656 - "children": Map {
8657 - "z" => ArboristNode {
8658 - "name": "z",
8659 - "version": "1.0.0",
8660 - "location": "node_modules/x/node_modules/y/node_modules/z",
8661 - "path": "/some/path/node_modules/x/node_modules/y/node_modules/z",
8662 - "extraneous": true,
8663 - "dev": true,
8664 - "optional": true,
8665 - "peer": true,
8666 - "edgesIn": Set {
8667 - EdgeIn {
8668 - "type": "prod",
8669 - "name": "z",
8670 - "spec": "1",
8671 - "from": "node_modules/x/node_modules/y",
8672 - },
8673 - },
8674 - },
8675 - },
8676 - },
8677 - },
8678 },
8679 "y" => ArboristNode {
8680 "name": "y",
8681 - "version": "1.1.0",
8682 + "version": "1.2.2",
8683 "location": "node_modules/y",
8684 "path": "/some/path/node_modules/y",
8685 "extraneous": true,
8686 @@ -294,12 +200,6 @@
8687 "spec": "1",
8688 "to": "node_modules/y/node_modules/z",
8689 },
8690 - "f" => EdgeOut {
8691 - "type": "prod",
8692 - "name": "f",
8693 - "spec": "*",
8694 - "to": "node_modules/f",
8695 - },
8696 },
8697 "edgesIn": Set {
8698 EdgeIn {
8699 @@ -308,6 +208,18 @@
8700 "spec": "1",
8701 "from": "",
8702 },
8703 + EdgeIn {
8704 + "type": "prod",
8705 + "name": "y",
8706 + "spec": "1.2",
8707 + "from": "k",
8708 + },
8709 + EdgeIn {
8710 + "type": "prod",
8711 + "name": "y",
8712 + "spec": "1.2",
8713 + "from": "node_modules/x",
8714 + },
8715 },
8716 "children": Map {
8717 "z" => ArboristNode {
8718 @@ -354,49 +266,5 @@
8719 },
8720 },
8721 },
8722 - "f" => ArboristNode {
8723 - "name": "f",
8724 - "version": "1.0.0",
8725 - "location": "node_modules/f",
8726 - "path": "/some/path/node_modules/f",
8727 - "extraneous": true,
8728 - "dev": true,
8729 - "optional": true,
8730 - "peer": true,
8731 - "edgesOut": Map {
8732 - "g" => EdgeOut {
8733 - "type": "prod",
8734 - "name": "g",
8735 - "spec": "*",
8736 - "to": "node_modules/g",
8737 - },
8738 - },
8739 - "edgesIn": Set {
8740 - EdgeIn {
8741 - "type": "prod",
8742 - "name": "f",
8743 - "spec": "*",
8744 - "from": "node_modules/y",
8745 - },
8746 - },
8747 - },
8748 - "g" => ArboristNode {
8749 - "name": "g",
8750 - "version": "1.0.0",
8751 - "location": "node_modules/g",
8752 - "path": "/some/path/node_modules/g",
8753 - "extraneous": true,
8754 - "dev": true,
8755 - "optional": true,
8756 - "peer": true,
8757 - "edgesIn": Set {
8758 - EdgeIn {
8759 - "type": "prod",
8760 - "name": "g",
8761 - "spec": "*",
8762 - "from": "node_modules/f",
8763 - },
8764 - },
8765 - },
8766 },
8767 }
8768
8769 `
8770
8771 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > changes to tree 2`] = `
8772 --- expected
8773 +++ actual
8774 @@ -24,7 +24,7 @@
8775 "children": Map {
8776 "a" => ArboristNode {
8777 "name": "a",
8778 - "version": "1.0.0",
8779 + "version": "1.1.1",
8780 "location": "node_modules/a",
8781 "path": "/some/path/node_modules/a",
8782 "extraneous": true,
8783 @@ -42,9 +42,14 @@
8784 "type": "prod",
8785 "name": "a",
8786 "spec": "1.1",
8787 - "error": "INVALID",
8788 "from": "node_modules/b",
8789 },
8790 + EdgeIn {
8791 + "type": "prod",
8792 + "name": "a",
8793 + "spec": "1.1.1",
8794 + "from": "node_modules/b/c",
8795 + },
8796 },
8797 },
8798 "b" => ArboristNode {
8799 @@ -62,7 +67,6 @@
8800 "name": "a",
8801 "spec": "1.1",
8802 "to": "node_modules/a",
8803 - "error": "INVALID",
8804 },
8805 "c" => EdgeOut {
8806 "type": "prod",
8807 @@ -95,29 +99,9 @@
8808 "type": "prod",
8809 "name": "a",
8810 "spec": "1.1.1",
8811 - "to": "node_modules/b/c/node_modules/a",
8812 + "to": "node_modules/a",
8813 },
8814 },
8815 - "children": Map {
8816 - "a" => ArboristNode {
8817 - "name": "a",
8818 - "version": "1.1.1",
8819 - "location": "node_modules/b/c/node_modules/a",
8820 - "path": "/some/path/node_modules/b/c/node_modules/a",
8821 - "extraneous": true,
8822 - "dev": true,
8823 - "optional": true,
8824 - "peer": true,
8825 - "edgesIn": Set {
8826 - EdgeIn {
8827 - "type": "prod",
8828 - "name": "a",
8829 - "spec": "1.1.1",
8830 - "from": "node_modules/b/c",
8831 - },
8832 - },
8833 - },
8834 - },
8835 },
8836 },
8837 },
8838
8839 `
8840
8841 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > placements 1`] = `
8842 Array [
8843 Object {
8844 "canPlace": Symbol(REPLACE),
8845 "canPlaceSelf": Symbol(REPLACE),
8846 "checks": Map {
8847 "node_modules/x" => Array [
8848 Symbol(REPLACE),
8849 Symbol(REPLACE),
8850 ],
8851 "" => Array [
8852 Symbol(REPLACE),
8853 Symbol(REPLACE),
8854 ],
8855 },
8856 "dep": "[email protected]",
8857 "edge": "{ node_modules/x prod [email protected] }",
8858 "placed": "node_modules/y",
8859 },
8860 ]
8861 `
8862
8863 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > placements 2`] = `
8864 Array [
8865 Object {
8866 "canPlace": Symbol(REPLACE),
8867 "canPlaceSelf": Symbol(REPLACE),
8868 "checks": Map {
8869 "node_modules/b" => Array [
8870 Symbol(OK),
8871 Symbol(OK),
8872 ],
8873 "" => Array [
8874 Symbol(REPLACE),
8875 Symbol(REPLACE),
8876 ],
8877 },
8878 "dep": "[email protected]",
8879 "edge": "{ node_modules/b prod [email protected] }",
8880 "placed": "node_modules/a",
8881 },
8882 ]
8883 `
8884
8885 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > warnings 1`] = `
8886 Array []
8887 `
8888
8889 exports[`test/place-dep.js TAP placement tests replace higher up, and dedupe descendants > warnings 2`] = `
8890 Array []
8891 `
8892
8893 exports[`test/place-dep.js TAP placement tests replace peer set of non-root dep already in root, step 2 > changes to tree 1`] = `
8894 --- expected
8895 +++ actual
8896 @@ -36,12 +36,14 @@
8897 "type": "prod",
8898 "name": "b",
8899 "spec": "1",
8900 - "to": "node_modules/b",
8901 + "error": "MISSING",
8902 + "to": null,
8903 },
8904 "y" => EdgeOut {
8905 "type": "prod",
8906 "name": "y",
8907 "spec": "1",
8908 + "error": "INVALID",
8909 "to": "node_modules/y",
8910 },
8911 },
8912 @@ -101,7 +103,6 @@
8913 "name": "y",
8914 "spec": "2",
8915 "to": "node_modules/y",
8916 - "error": "INVALID",
8917 },
8918 },
8919 "edgesIn": Set {
8920 @@ -128,7 +129,6 @@
8921 "name": "y",
8922 "spec": "2",
8923 "to": "node_modules/y",
8924 - "error": "INVALID",
8925 },
8926 },
8927 "edgesIn": Set {
8928 @@ -142,7 +142,7 @@
8929 },
8930 "y" => ArboristNode {
8931 "name": "y",
8932 - "version": "1.0.0",
8933 + "version": "2.0.0",
8934 "location": "node_modules/y",
8935 "path": "/some/path/node_modules/y",
8936 "extraneous": true,
8937 @@ -154,55 +154,22 @@
8938 "type": "prod",
8939 "name": "y",
8940 "spec": "1",
8941 + "error": "INVALID",
8942 "from": "node_modules/a",
8943 },
8944 EdgeIn {
8945 - "type": "peer",
8946 - "name": "y",
8947 - "spec": "1",
8948 - "from": "node_modules/b",
8949 - },
8950 - EdgeIn {
8951 "type": "prod",
8952 "name": "y",
8953 "spec": "2",
8954 - "error": "INVALID",
8955 "from": "node_modules/l",
8956 },
8957 EdgeIn {
8958 "type": "peer",
8959 "name": "y",
8960 "spec": "2",
8961 - "error": "INVALID",
8962 "from": "node_modules/x",
8963 },
8964 },
8965 },
8966 - "b" => ArboristNode {
8967 - "name": "b",
8968 - "version": "1.0.0",
8969 - "location": "node_modules/b",
8970 - "path": "/some/path/node_modules/b",
8971 - "extraneous": true,
8972 - "dev": true,
8973 - "optional": true,
8974 - "peer": true,
8975 - "edgesOut": Map {
8976 - "y" => EdgeOut {
8977 - "type": "peer",
8978 - "name": "y",
8979 - "spec": "1",
8980 - "to": "node_modules/y",
8981 - },
8982 - },
8983 - "edgesIn": Set {
8984 - EdgeIn {
8985 - "type": "prod",
8986 - "name": "b",
8987 - "spec": "1",
8988 - "from": "node_modules/a",
8989 - },
8990 - },
8991 - },
8992 },
8993 }
8994
8995 `
8996
8997 exports[`test/place-dep.js TAP placement tests replace peer set of non-root dep already in root, step 2 > must match snapshot 1`] = `
8998 Array [
8999 "node_modules/a 1.0.0",
9000 ]
9001 `
9002
9003 exports[`test/place-dep.js TAP placement tests replace peer set of non-root dep already in root, step 2 > placements 1`] = `
9004 Array [
9005 Object {
9006 "canPlace": Symbol(REPLACE),
9007 "canPlaceSelf": Symbol(REPLACE),
9008 "checks": Map {
9009 "" => Array [
9010 Symbol(REPLACE),
9011 Symbol(REPLACE),
9012 ],
9013 },
9014 "dep": "[email protected]",
9015 "edge": "{ node_modules/x peer y@2 }",
9016 "placed": "node_modules/y",
9017 },
9018 ]
9019 `
9020
9021 exports[`test/place-dep.js TAP placement tests replace peer set of non-root dep already in root, step 2 > warnings 1`] = `
9022 Array []
9023 `
9024
9025 exports[`test/place-dep.js TAP placement tests replacing existing peer set > changes to tree 1`] = `
9026 --- expected
9027 +++ actual
9028 @@ -26,7 +26,7 @@
9029 "children": Map {
9030 "a" => ArboristNode {
9031 "name": "a",
9032 - "version": "1.0.1",
9033 + "version": "1.2.3",
9034 "location": "node_modules/a",
9035 "path": "/some/path/node_modules/a",
9036 "extraneous": true,
9037 @@ -53,6 +53,7 @@
9038 "name": "a",
9039 "spec": "2",
9040 "error": "INVALID",
9041 + "peerConflicted": true,
9042 "from": "node_modules/c",
9043 },
9044 },
9045 @@ -106,6 +107,7 @@
9046 "name": "a",
9047 "spec": "2",
9048 "error": "INVALID",
9049 + "peerConflicted": true,
9050 "to": "node_modules/a",
9051 },
9052 "b" => EdgeOut {
9053
9054 `
9055
9056 exports[`test/place-dep.js TAP placement tests replacing existing peer set > placements 1`] = `
9057 Array [
9058 Object {
9059 "canPlace": Symbol(REPLACE),
9060 "canPlaceSelf": Symbol(REPLACE),
9061 "checks": Map {
9062 "" => Array [
9063 Symbol(REPLACE),
9064 Symbol(REPLACE),
9065 ],
9066 },
9067 "dep": "[email protected]",
9068 "edge": "{ ROOT prod [email protected] }",
9069 "placed": "node_modules/a",
9070 },
9071 ]
9072 `
9073
9074 exports[`test/place-dep.js TAP placement tests replacing existing peer set > warnings 1`] = `
9075 Array [
9076 Array [
9077 "ERESOLVE",
9078 "overriding peer dependency",
9079 Object {
9080 "code": "ERESOLVE",
9081 "current": Object {
9082 "dependents": Array [
9083 Object {
9084 "from": Object {
9085 "location": "/some/path",
9086 },
9087 "name": "a",
9088 "spec": "1.x",
9089 "type": "prod",
9090 },
9091 ],
9092 "isWorkspace": false,
9093 "location": "node_modules/a",
9094 "name": "a",
9095 "version": "1.0.1",
9096 },
9097 "dep": Object {
9098 "dependents": Array [
9099 Object {
9100 "error": "INVALID",
9101 "from": Object {
9102 "dependents": Array [
9103 Object {
9104 "from": Object {
9105 "location": "/some/path",
9106 },
9107 "name": "c",
9108 "spec": "2.x",
9109 "type": "prod",
9110 },
9111 ],
9112 "isWorkspace": false,
9113 "location": "node_modules/c",
9114 "name": "c",
9115 "version": "2.0.1",
9116 },
9117 "name": "a",
9118 "spec": "2",
9119 "type": "peer",
9120 },
9121 ],
9122 "isWorkspace": false,
9123 "location": "node_modules/a",
9124 "name": "a",
9125 "version": "1.2.3",
9126 "whileInstalling": Object {
9127 "name": "project",
9128 "path": "/some/path",
9129 "version": "1.2.3",
9130 },
9131 },
9132 "edge": Object {
9133 "error": "INVALID",
9134 "from": Object {
9135 "dependents": Array [
9136 Object {
9137 "from": Object {
9138 "location": "/some/path",
9139 },
9140 "name": "c",
9141 "spec": "2.x",
9142 "type": "prod",
9143 },
9144 ],
9145 "isWorkspace": false,
9146 "location": "node_modules/c",
9147 "name": "c",
9148 "version": "2.0.1",
9149 },
9150 "name": "a",
9151 "spec": "2",
9152 "type": "peer",
9153 },
9154 "force": false,
9155 "isMine": true,
9156 "strictPeerDeps": false,
9157 },
9158 ],
9159 ]
9160 `
9161
9162 exports[`test/place-dep.js TAP placement tests replacing overlapping peer sets > changes to tree 1`] = `
9163 --- expected
9164 +++ actual
9165 @@ -18,14 +18,13 @@
9166 "type": "prod",
9167 "name": "y",
9168 "spec": "1",
9169 - "to": null,
9170 - "error": "MISSING",
9171 + "to": "node_modules/y",
9172 },
9173 },
9174 "children": Map {
9175 "a" => ArboristNode {
9176 "name": "a",
9177 - "version": "2.0.0",
9178 + "version": "1.0.0",
9179 "location": "node_modules/a",
9180 "path": "/some/path/node_modules/a",
9181 "extraneous": true,
9182 @@ -36,7 +35,7 @@
9183 "b" => EdgeOut {
9184 "type": "peer",
9185 "name": "b",
9186 - "spec": "2",
9187 + "spec": "1",
9188 "to": "node_modules/b",
9189 },
9190 },
9191 @@ -44,20 +43,20 @@
9192 EdgeIn {
9193 "type": "peer",
9194 "name": "a",
9195 - "spec": "1||2",
9196 - "from": "node_modules/v",
9197 + "spec": "1",
9198 + "from": "node_modules/e",
9199 },
9200 EdgeIn {
9201 "type": "peer",
9202 "name": "a",
9203 - "spec": "2",
9204 - "from": "node_modules/e",
9205 + "spec": "1||2",
9206 + "from": "node_modules/v",
9207 },
9208 },
9209 },
9210 "b" => ArboristNode {
9211 "name": "b",
9212 - "version": "2.0.0",
9213 + "version": "1.0.0",
9214 "location": "node_modules/b",
9215 "path": "/some/path/node_modules/b",
9216 "extraneous": true,
9217 @@ -68,7 +67,7 @@
9218 "c" => EdgeOut {
9219 "type": "peer",
9220 "name": "c",
9221 - "spec": "2",
9222 + "spec": "1",
9223 "to": "node_modules/c",
9224 },
9225 },
9226 @@ -76,14 +75,14 @@
9227 EdgeIn {
9228 "type": "peer",
9229 "name": "b",
9230 - "spec": "2",
9231 + "spec": "1",
9232 "from": "node_modules/a",
9233 },
9234 },
9235 },
9236 "c" => ArboristNode {
9237 "name": "c",
9238 - "version": "2.0.0",
9239 + "version": "1.0.0",
9240 "location": "node_modules/c",
9241 "path": "/some/path/node_modules/c",
9242 "extraneous": true,
9243 @@ -94,7 +93,7 @@
9244 "d" => EdgeOut {
9245 "type": "peer",
9246 "name": "d",
9247 - "spec": "2",
9248 + "spec": "1",
9249 "to": "node_modules/d",
9250 },
9251 },
9252 @@ -102,14 +101,14 @@
9253 EdgeIn {
9254 "type": "peer",
9255 "name": "c",
9256 - "spec": "2",
9257 + "spec": "1",
9258 "from": "node_modules/b",
9259 },
9260 },
9261 },
9262 "d" => ArboristNode {
9263 "name": "d",
9264 - "version": "2.0.0",
9265 + "version": "1.0.0",
9266 "location": "node_modules/d",
9267 "path": "/some/path/node_modules/d",
9268 "extraneous": true,
9269 @@ -120,7 +119,7 @@
9270 "e" => EdgeOut {
9271 "type": "peer",
9272 "name": "e",
9273 - "spec": "2",
9274 + "spec": "1",
9275 "to": "node_modules/e",
9276 },
9277 },
9278 @@ -128,14 +127,20 @@
9279 EdgeIn {
9280 "type": "peer",
9281 "name": "d",
9282 - "spec": "2",
9283 + "spec": "1",
9284 "from": "node_modules/c",
9285 },
9286 + EdgeIn {
9287 + "type": "peer",
9288 + "name": "d",
9289 + "spec": "1",
9290 + "from": "node_modules/y",
9291 + },
9292 },
9293 },
9294 "e" => ArboristNode {
9295 "name": "e",
9296 - "version": "2.0.0",
9297 + "version": "1.0.0",
9298 "location": "node_modules/e",
9299 "path": "/some/path/node_modules/e",
9300 "extraneous": true,
9301 @@ -146,7 +151,7 @@
9302 "a" => EdgeOut {
9303 "type": "peer",
9304 "name": "a",
9305 - "spec": "2",
9306 + "spec": "1",
9307 "to": "node_modules/a",
9308 },
9309 },
9310 @@ -154,7 +159,7 @@
9311 EdgeIn {
9312 "type": "peer",
9313 "name": "e",
9314 - "spec": "2",
9315 + "spec": "1",
9316 "from": "node_modules/d",
9317 },
9318 },
9319 @@ -191,5 +196,31 @@
9320 },
9321 },
9322 },
9323 + "y" => ArboristNode {
9324 + "name": "y",
9325 + "version": "1.0.0",
9326 + "location": "node_modules/y",
9327 + "path": "/some/path/node_modules/y",
9328 + "extraneous": true,
9329 + "dev": true,
9330 + "optional": true,
9331 + "peer": true,
9332 + "edgesOut": Map {
9333 + "d" => EdgeOut {
9334 + "type": "peer",
9335 + "name": "d",
9336 + "spec": "1",
9337 + "to": "node_modules/d",
9338 + },
9339 + },
9340 + "edgesIn": Set {
9341 + EdgeIn {
9342 + "type": "prod",
9343 + "name": "y",
9344 + "spec": "1",
9345 + "from": "",
9346 + },
9347 + },
9348 + },
9349 },
9350 }
9351
9352 `
9353
9354 exports[`test/place-dep.js TAP placement tests replacing overlapping peer sets > placements 1`] = `
9355 Array [
9356 Object {
9357 "canPlace": Symbol(OK),
9358 "canPlaceSelf": Symbol(OK),
9359 "checks": Map {
9360 "" => Array [
9361 Symbol(OK),
9362 Symbol(OK),
9363 ],
9364 },
9365 "dep": "[email protected]",
9366 "edge": "{ ROOT prod y@1 }",
9367 "placed": "node_modules/y",
9368 },
9369 Object {
9370 "canPlace": Symbol(REPLACE),
9371 "canPlaceSelf": Symbol(REPLACE),
9372 "checks": Map {
9373 "" => Array [
9374 Symbol(OK),
9375 Symbol(OK),
9376 ],
9377 },
9378 "dep": "[email protected]",
9379 "edge": "{ node_modules/y peer d@1 }",
9380 "parent": "y",
9381 "placed": "node_modules/d",
9382 },
9383 Object {
9384 "canPlace": Symbol(OK),
9385 "canPlaceSelf": Symbol(OK),
9386 "checks": Map {
9387 "" => Array [
9388 Symbol(OK),
9389 Symbol(OK),
9390 ],
9391 },
9392 "dep": "[email protected]",
9393 "edge": "{ node_modules/d peer e@1 }",
9394 "parent": "d",
9395 "placed": "node_modules/e",
9396 },
9397 Object {
9398 "canPlace": Symbol(REPLACE),
9399 "canPlaceSelf": Symbol(REPLACE),
9400 "checks": Map {
9401 "" => Array [
9402 Symbol(OK),
9403 Symbol(OK),
9404 ],
9405 },
9406 "dep": "[email protected]",
9407 "edge": "{ node_modules/e peer a@1 }",
9408 "parent": "e",
9409 "placed": "node_modules/a",
9410 },
9411 Object {
9412 "canPlace": Symbol(OK),
9413 "canPlaceSelf": Symbol(OK),
9414 "checks": Map {
9415 "" => Array [
9416 Symbol(OK),
9417 Symbol(OK),
9418 ],
9419 },
9420 "dep": "[email protected]",
9421 "edge": "{ node_modules/a peer b@1 }",
9422 "parent": "a",
9423 "placed": "node_modules/b",
9424 },
9425 Object {
9426 "canPlace": Symbol(OK),
9427 "canPlaceSelf": Symbol(OK),
9428 "checks": Map {
9429 "" => Array [
9430 Symbol(OK),
9431 Symbol(OK),
9432 ],
9433 },
9434 "dep": "[email protected]",
9435 "edge": "{ node_modules/b peer c@1 }",
9436 "parent": "b",
9437 "placed": "node_modules/c",
9438 },
9439 ]
9440 `
9441
9442 exports[`test/place-dep.js TAP placement tests replacing overlapping peer sets > warnings 1`] = `
9443 Array [
9444 Array [
9445 "ERESOLVE",
9446 "overriding peer dependency",
9447 Object {
9448 "code": "ERESOLVE",
9449 "current": Object {
9450 "dependents": Array [
9451 Object {
9452 "from": Object {
9453 "name": "c",
9454 "version": "2.0.0",
9455 },
9456 "name": "d",
9457 "spec": "2",
9458 "type": "peer",
9459 },
9460 ],
9461 "isWorkspace": false,
9462 "location": "node_modules/d",
9463 "name": "d",
9464 "version": "2.0.0",
9465 },
9466 "dep": Object {
9467 "dependents": Array [
9468 Object {
9469 "from": Object {
9470 "dependents": Array [
9471 Object {
9472 "from": Object {
9473 "dependents": Array [
9474 Object {
9475 "from": Object {
9476 "dependents": Array [
9477 Object {
9478 "from": Object {
9479 "dependents": Array [
9480 Object {
9481 "from": Object {
9482 "location": "/some/path",
9483 },
9484 "name": "v",
9485 "spec": "4",
9486 "type": "prod",
9487 },
9488 ],
9489 "isWorkspace": false,
9490 "location": "node_modules/v",
9491 "name": "v",
9492 "version": "4.0.0",
9493 },
9494 "name": "a",
9495 "spec": "1||2",
9496 "type": "peer",
9497 },
9498 Object {
9499 "from": Object {
9500 "dependents": Array [
9501 Object {
9502 "from": Object {
9503 "dependents": Array [
9504 Object {
9505 "from": Object {
9506 "name": "c",
9507 "version": "2.0.0",
9508 },
9509 "name": "d",
9510 "spec": "2",
9511 "type": "peer",
9512 },
9513 ],
9514 "isWorkspace": false,
9515 "location": "node_modules/d",
9516 "name": "d",
9517 "version": "2.0.0",
9518 },
9519 "name": "e",
9520 "spec": "2",
9521 "type": "peer",
9522 },
9523 ],
9524 "isWorkspace": false,
9525 "location": "node_modules/e",
9526 "name": "e",
9527 "version": "2.0.0",
9528 },
9529 "name": "a",
9530 "spec": "2",
9531 "type": "peer",
9532 },
9533 ],
9534 "isWorkspace": false,
9535 "location": "node_modules/a",
9536 "name": "a",
9537 "version": "2.0.0",
9538 },
9539 "name": "b",
9540 "spec": "2",
9541 "type": "peer",
9542 },
9543 ],
9544 "isWorkspace": false,
9545 "location": "node_modules/b",
9546 "name": "b",
9547 "version": "2.0.0",
9548 },
9549 "name": "c",
9550 "spec": "2",
9551 "type": "peer",
9552 },
9553 ],
9554 "isWorkspace": false,
9555 "location": "node_modules/c",
9556 "name": "c",
9557 "version": "2.0.0",
9558 },
9559 "name": "d",
9560 "spec": "2",
9561 "type": "peer",
9562 },
9563 ],
9564 "isWorkspace": false,
9565 "location": "node_modules/d",
9566 "name": "d",
9567 "version": "1.0.0",
9568 "whileInstalling": Object {
9569 "name": undefined,
9570 "path": "/some/path",
9571 "version": undefined,
9572 },
9573 },
9574 "edge": Object {
9575 "from": Object {
9576 "dependents": Array [
9577 Object {
9578 "from": Object {
9579 "dependents": Array [
9580 Object {
9581 "from": Object {
9582 "dependents": Array [
9583 Object {
9584 "from": Object {
9585 "dependents": Array [
9586 Object {
9587 "from": Object {
9588 "location": "/some/path",
9589 },
9590 "name": "v",
9591 "spec": "4",
9592 "type": "prod",
9593 },
9594 ],
9595 "isWorkspace": false,
9596 "location": "node_modules/v",
9597 "name": "v",
9598 "version": "4.0.0",
9599 },
9600 "name": "a",
9601 "spec": "1||2",
9602 "type": "peer",
9603 },
9604 Object {
9605 "from": Object {
9606 "dependents": Array [
9607 Object {
9608 "from": Object {
9609 "dependents": Array [
9610 Object {
9611 "from": Object {
9612 "name": "c",
9613 "version": "2.0.0",
9614 },
9615 "name": "d",
9616 "spec": "2",
9617 "type": "peer",
9618 },
9619 ],
9620 "isWorkspace": false,
9621 "location": "node_modules/d",
9622 "name": "d",
9623 "version": "2.0.0",
9624 },
9625 "name": "e",
9626 "spec": "2",
9627 "type": "peer",
9628 },
9629 ],
9630 "isWorkspace": false,
9631 "location": "node_modules/e",
9632 "name": "e",
9633 "version": "2.0.0",
9634 },
9635 "name": "a",
9636 "spec": "2",
9637 "type": "peer",
9638 },
9639 ],
9640 "isWorkspace": false,
9641 "location": "node_modules/a",
9642 "name": "a",
9643 "version": "2.0.0",
9644 },
9645 "name": "b",
9646 "spec": "2",
9647 "type": "peer",
9648 },
9649 ],
9650 "isWorkspace": false,
9651 "location": "node_modules/b",
9652 "name": "b",
9653 "version": "2.0.0",
9654 },
9655 "name": "c",
9656 "spec": "2",
9657 "type": "peer",
9658 },
9659 ],
9660 "isWorkspace": false,
9661 "location": "node_modules/c",
9662 "name": "c",
9663 "version": "2.0.0",
9664 },
9665 "name": "d",
9666 "spec": "2",
9667 "type": "peer",
9668 },
9669 "force": false,
9670 "isMine": true,
9671 "peerConflict": Object {
9672 "dependents": Array [
9673 Object {
9674 "from": Object {
9675 "name": "c",
9676 "version": "2.0.0",
9677 },
9678 "name": "d",
9679 "spec": "2",
9680 "type": "peer",
9681 },
9682 ],
9683 "isWorkspace": false,
9684 "location": "node_modules/d",
9685 "name": "d",
9686 "version": "2.0.0",
9687 },
9688 "strictPeerDeps": false,
9689 },
9690 ],
9691 ]
9692 `
9693
9694 exports[`test/place-dep.js TAP placement tests replacing partially overlapping divergent peer sets > changes to tree 1`] = `
9695 --- expected
9696 +++ actual
9697 @@ -18,14 +18,13 @@
9698 "type": "prod",
9699 "name": "w",
9700 "spec": "*",
9701 - "to": null,
9702 - "error": "MISSING",
9703 + "to": "node_modules/w",
9704 },
9705 },
9706 "children": Map {
9707 "a" => ArboristNode {
9708 "name": "a",
9709 - "version": "2.0.0",
9710 + "version": "1.0.0",
9711 "location": "node_modules/a",
9712 "path": "/some/path/node_modules/a",
9713 "extraneous": true,
9714 @@ -36,14 +35,14 @@
9715 "c" => EdgeOut {
9716 "type": "peer",
9717 "name": "c",
9718 - "spec": "2",
9719 + "spec": "1",
9720 "to": "node_modules/c",
9721 },
9722 - "e" => EdgeOut {
9723 + "d" => EdgeOut {
9724 "type": "peer",
9725 - "name": "e",
9726 + "name": "d",
9727 "spec": "1",
9728 - "to": "node_modules/e",
9729 + "to": "node_modules/d",
9730 },
9731 },
9732 "edgesIn": Set {
9733 @@ -56,6 +55,12 @@
9734 EdgeIn {
9735 "type": "peer",
9736 "name": "a",
9737 + "spec": "1",
9738 + "from": "node_modules/w",
9739 + },
9740 + EdgeIn {
9741 + "type": "peer",
9742 + "name": "a",
9743 "spec": "1||2",
9744 "from": "node_modules/y",
9745 },
9746 @@ -63,7 +68,7 @@
9747 },
9748 "c" => ArboristNode {
9749 "name": "c",
9750 - "version": "2.0.0",
9751 + "version": "1.0.0",
9752 "location": "node_modules/c",
9753 "path": "/some/path/node_modules/c",
9754 "extraneous": true,
9755 @@ -74,11 +79,55 @@
9756 EdgeIn {
9757 "type": "peer",
9758 "name": "c",
9759 - "spec": "2",
9760 + "spec": "1",
9761 "from": "node_modules/a",
9762 },
9763 },
9764 },
9765 + "d" => ArboristNode {
9766 + "name": "d",
9767 + "version": "1.0.0",
9768 + "location": "node_modules/d",
9769 + "path": "/some/path/node_modules/d",
9770 + "extraneous": true,
9771 + "dev": true,
9772 + "optional": true,
9773 + "peer": true,
9774 + "edgesIn": Set {
9775 + EdgeIn {
9776 + "type": "peer",
9777 + "name": "d",
9778 + "spec": "1",
9779 + "from": "node_modules/a",
9780 + },
9781 + },
9782 + },
9783 + "j" => ArboristNode {
9784 + "name": "j",
9785 + "version": "1.0.0",
9786 + "location": "node_modules/j",
9787 + "path": "/some/path/node_modules/j",
9788 + "extraneous": true,
9789 + "dev": true,
9790 + "optional": true,
9791 + "peer": true,
9792 + "edgesOut": Map {
9793 + "y" => EdgeOut {
9794 + "type": "peer",
9795 + "name": "y",
9796 + "spec": "1",
9797 + "to": "node_modules/y",
9798 + },
9799 + },
9800 + "edgesIn": Set {
9801 + EdgeIn {
9802 + "type": "peer",
9803 + "name": "j",
9804 + "spec": "1",
9805 + "from": "node_modules/w",
9806 + },
9807 + },
9808 + },
9809 "v" => ArboristNode {
9810 "name": "v",
9811 "version": "1.0.0",
9812 @@ -111,6 +160,38 @@
9813 },
9814 },
9815 },
9816 + "w" => ArboristNode {
9817 + "name": "w",
9818 + "version": "1.0.0",
9819 + "location": "node_modules/w",
9820 + "path": "/some/path/node_modules/w",
9821 + "extraneous": true,
9822 + "dev": true,
9823 + "optional": true,
9824 + "peer": true,
9825 + "edgesOut": Map {
9826 + "a" => EdgeOut {
9827 + "type": "peer",
9828 + "name": "a",
9829 + "spec": "1",
9830 + "to": "node_modules/a",
9831 + },
9832 + "j" => EdgeOut {
9833 + "type": "peer",
9834 + "name": "j",
9835 + "spec": "1",
9836 + "to": "node_modules/j",
9837 + },
9838 + },
9839 + "edgesIn": Set {
9840 + EdgeIn {
9841 + "type": "prod",
9842 + "name": "w",
9843 + "spec": "*",
9844 + "from": "",
9845 + },
9846 + },
9847 + },
9848 "x" => ArboristNode {
9849 "name": "x",
9850 "version": "1.0.0",
9851 @@ -159,25 +240,13 @@
9852 "type": "peer",
9853 "name": "y",
9854 "spec": "1",
9855 - "from": "node_modules/x",
9856 + "from": "node_modules/j",
9857 },
9858 - },
9859 - },
9860 - "e" => ArboristNode {
9861 - "name": "e",
9862 - "version": "1.0.0",
9863 - "location": "node_modules/e",
9864 - "path": "/some/path/node_modules/e",
9865 - "extraneous": true,
9866 - "dev": true,
9867 - "optional": true,
9868 - "peer": true,
9869 - "edgesIn": Set {
9870 EdgeIn {
9871 "type": "peer",
9872 - "name": "e",
9873 + "name": "y",
9874 "spec": "1",
9875 - "from": "node_modules/a",
9876 + "from": "node_modules/x",
9877 },
9878 },
9879 },
9880
9881 `
9882
9883 exports[`test/place-dep.js TAP placement tests replacing partially overlapping divergent peer sets > placements 1`] = `
9884 Array [
9885 Object {
9886 "canPlace": Symbol(OK),
9887 "canPlaceSelf": Symbol(OK),
9888 "checks": Map {
9889 "" => Array [
9890 Symbol(OK),
9891 Symbol(OK),
9892 ],
9893 },
9894 "dep": "[email protected]",
9895 "edge": "{ ROOT prod w@ }",
9896 "placed": "node_modules/w",
9897 },
9898 Object {
9899 "canPlace": Symbol(REPLACE),
9900 "canPlaceSelf": Symbol(REPLACE),
9901 "checks": Map {
9902 "" => Array [
9903 Symbol(OK),
9904 Symbol(OK),
9905 ],
9906 },
9907 "dep": "[email protected]",
9908 "edge": "{ node_modules/w peer a@1 }",
9909 "parent": "w",
9910 "placed": "node_modules/a",
9911 },
9912 Object {
9913 "canPlace": Symbol(OK),
9914 "canPlaceSelf": Symbol(OK),
9915 "checks": Map {
9916 "" => Array [
9917 Symbol(OK),
9918 Symbol(OK),
9919 ],
9920 },
9921 "dep": "[email protected]",
9922 "edge": "{ node_modules/w peer j@1 }",
9923 "parent": "w",
9924 "placed": "node_modules/j",
9925 },
9926 Object {
9927 "canPlace": Symbol(OK),
9928 "canPlaceSelf": Symbol(OK),
9929 "checks": Map {
9930 "" => Array [
9931 Symbol(OK),
9932 Symbol(OK),
9933 ],
9934 },
9935 "dep": "[email protected]",
9936 "edge": "{ node_modules/a peer c@1 }",
9937 "parent": "a",
9938 "placed": "node_modules/c",
9939 },
9940 Object {
9941 "canPlace": Symbol(OK),
9942 "canPlaceSelf": Symbol(OK),
9943 "checks": Map {
9944 "" => Array [
9945 Symbol(OK),
9946 Symbol(OK),
9947 ],
9948 },
9949 "dep": "[email protected]",
9950 "edge": "{ node_modules/a peer d@1 }",
9951 "parent": "a",
9952 "placed": "node_modules/d",
9953 },
9954 ]
9955 `
9956
9957 exports[`test/place-dep.js TAP placement tests replacing partially overlapping divergent peer sets > warnings 1`] = `
9958 Array []
9959 `
9960
9961 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, subset > changes to tree 1`] = `
9962 --- expected
9963 +++ actual
9964 @@ -18,8 +18,7 @@
9965 "type": "prod",
9966 "name": "y",
9967 "spec": "1",
9968 - "to": null,
9969 - "error": "MISSING",
9970 + "to": "node_modules/y",
9971 },
9972 },
9973 "children": Map {
9974 @@ -131,6 +130,13 @@
9975 "spec": "2",
9976 "from": "node_modules/c",
9977 },
9978 + EdgeIn {
9979 + "type": "peer",
9980 + "name": "d",
9981 + "spec": "1",
9982 + "error": "INVALID",
9983 + "from": "node_modules/y",
9984 + },
9985 },
9986 },
9987 "e" => ArboristNode {
9988 @@ -191,5 +197,32 @@
9989 },
9990 },
9991 },
9992 + "y" => ArboristNode {
9993 + "name": "y",
9994 + "version": "1.0.0",
9995 + "location": "node_modules/y",
9996 + "path": "/some/path/node_modules/y",
9997 + "extraneous": true,
9998 + "dev": true,
9999 + "optional": true,
10000 + "peer": true,
10001 + "edgesOut": Map {
10002 + "d" => EdgeOut {
10003 + "type": "peer",
10004 + "name": "d",
10005 + "spec": "1",
10006 + "error": "INVALID",
10007 + "to": "node_modules/d",
10008 + },
10009 + },
10010 + "edgesIn": Set {
10011 + EdgeIn {
10012 + "type": "prod",
10013 + "name": "y",
10014 + "spec": "1",
10015 + "from": "",
10016 + },
10017 + },
10018 + },
10019 },
10020 }
10021
10022 `
10023
10024 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, subset > placements 1`] = `
10025 Array [
10026 Object {
10027 "canPlace": Symbol(OK),
10028 "canPlaceSelf": Symbol(OK),
10029 "checks": Map {
10030 "" => Array [
10031 Symbol(OK),
10032 Symbol(OK),
10033 ],
10034 },
10035 "dep": "[email protected]",
10036 "edge": "{ ROOT prod y@1 }",
10037 "placed": "node_modules/y",
10038 },
10039 ]
10040 `
10041
10042 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, subset > warnings 1`] = `
10043 Array []
10044 `
10045
10046 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, superset > changes to tree 1`] = `
10047 --- expected
10048 +++ actual
10049 @@ -18,14 +18,13 @@
10050 "type": "prod",
10051 "name": "y",
10052 "spec": "1",
10053 - "to": null,
10054 - "error": "MISSING",
10055 + "to": "node_modules/y",
10056 },
10057 },
10058 "children": Map {
10059 "a" => ArboristNode {
10060 "name": "a",
10061 - "version": "2.0.0",
10062 + "version": "1.0.0",
10063 "location": "node_modules/a",
10064 "path": "/some/path/node_modules/a",
10065 "extraneous": true,
10066 @@ -33,31 +32,57 @@
10067 "optional": true,
10068 "peer": true,
10069 "edgesOut": Map {
10070 - "c" => EdgeOut {
10071 + "b" => EdgeOut {
10072 "type": "peer",
10073 - "name": "c",
10074 - "spec": "2",
10075 - "to": "node_modules/c",
10076 + "name": "b",
10077 + "spec": "1",
10078 + "to": "node_modules/b",
10079 },
10080 },
10081 "edgesIn": Set {
10082 EdgeIn {
10083 "type": "peer",
10084 "name": "a",
10085 + "spec": "1",
10086 + "from": "node_modules/e",
10087 + },
10088 + EdgeIn {
10089 + "type": "peer",
10090 + "name": "a",
10091 "spec": "1||2",
10092 "from": "node_modules/v",
10093 },
10094 + },
10095 + },
10096 + "b" => ArboristNode {
10097 + "name": "b",
10098 + "version": "1.0.0",
10099 + "location": "node_modules/b",
10100 + "path": "/some/path/node_modules/b",
10101 + "extraneous": true,
10102 + "dev": true,
10103 + "optional": true,
10104 + "peer": true,
10105 + "edgesOut": Map {
10106 + "c" => EdgeOut {
10107 + "type": "peer",
10108 + "name": "c",
10109 + "spec": "1",
10110 + "to": "node_modules/c",
10111 + },
10112 + },
10113 + "edgesIn": Set {
10114 EdgeIn {
10115 "type": "peer",
10116 - "name": "a",
10117 - "spec": "2",
10118 - "from": "node_modules/e",
10119 + "name": "b",
10120 + "spec": "1",
10121 + "from": "node_modules/a",
10122 },
10123 },
10124 },
10125 "c" => ArboristNode {
10126 "name": "c",
10127 - "version": "2.0.0",
10128 + "version": "1.0.0",
10129 "location": "node_modules/c",
10130 "path": "/some/path/node_modules/c",
10131 "extraneous": true,
10132 @@ -65,25 +90,57 @@
10133 "optional": true,
10134 "peer": true,
10135 "edgesOut": Map {
10136 + "d" => EdgeOut {
10137 + "type": "peer",
10138 + "name": "d",
10139 + "spec": "1",
10140 + "to": "node_modules/d",
10141 + },
10142 + },
10143 + "edgesIn": Set {
10144 + EdgeIn {
10145 + "type": "peer",
10146 + "name": "c",
10147 + "spec": "1",
10148 + "from": "node_modules/b",
10149 + },
10150 + },
10151 + },
10152 + "d" => ArboristNode {
10153 + "name": "d",
10154 + "version": "1.0.0",
10155 + "location": "node_modules/d",
10156 + "path": "/some/path/node_modules/d",
10157 + "extraneous": true,
10158 + "dev": true,
10159 + "optional": true,
10160 + "peer": true,
10161 + "edgesOut": Map {
10162 "e" => EdgeOut {
10163 "type": "peer",
10164 "name": "e",
10165 - "spec": "2",
10166 + "spec": "1",
10167 "to": "node_modules/e",
10168 },
10169 },
10170 "edgesIn": Set {
10171 EdgeIn {
10172 "type": "peer",
10173 - "name": "c",
10174 - "spec": "2",
10175 - "from": "node_modules/a",
10176 + "name": "d",
10177 + "spec": "1",
10178 + "from": "node_modules/c",
10179 },
10180 + EdgeIn {
10181 + "type": "peer",
10182 + "name": "d",
10183 + "spec": "1",
10184 + "from": "node_modules/y",
10185 + },
10186 },
10187 },
10188 "e" => ArboristNode {
10189 "name": "e",
10190 - "version": "2.0.0",
10191 + "version": "1.0.0",
10192 "location": "node_modules/e",
10193 "path": "/some/path/node_modules/e",
10194 "extraneous": true,
10195 @@ -94,7 +151,7 @@
10196 "a" => EdgeOut {
10197 "type": "peer",
10198 "name": "a",
10199 - "spec": "2",
10200 + "spec": "1",
10201 "to": "node_modules/a",
10202 },
10203 },
10204 @@ -102,8 +159,8 @@
10205 EdgeIn {
10206 "type": "peer",
10207 "name": "e",
10208 - "spec": "2",
10209 - "from": "node_modules/c",
10210 + "spec": "1",
10211 + "from": "node_modules/d",
10212 },
10213 },
10214 },
10215 @@ -139,5 +196,31 @@
10216 },
10217 },
10218 },
10219 + "y" => ArboristNode {
10220 + "name": "y",
10221 + "version": "1.0.0",
10222 + "location": "node_modules/y",
10223 + "path": "/some/path/node_modules/y",
10224 + "extraneous": true,
10225 + "dev": true,
10226 + "optional": true,
10227 + "peer": true,
10228 + "edgesOut": Map {
10229 + "d" => EdgeOut {
10230 + "type": "peer",
10231 + "name": "d",
10232 + "spec": "1",
10233 + "to": "node_modules/d",
10234 + },
10235 + },
10236 + "edgesIn": Set {
10237 + EdgeIn {
10238 + "type": "prod",
10239 + "name": "y",
10240 + "spec": "1",
10241 + "from": "",
10242 + },
10243 + },
10244 + },
10245 },
10246 }
10247
10248 `
10249
10250 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, superset > placements 1`] = `
10251 Array [
10252 Object {
10253 "canPlace": Symbol(OK),
10254 "canPlaceSelf": Symbol(OK),
10255 "checks": Map {
10256 "" => Array [
10257 Symbol(OK),
10258 Symbol(OK),
10259 ],
10260 },
10261 "dep": "[email protected]",
10262 "edge": "{ ROOT prod y@1 }",
10263 "placed": "node_modules/y",
10264 },
10265 Object {
10266 "canPlace": Symbol(OK),
10267 "canPlaceSelf": Symbol(OK),
10268 "checks": Map {
10269 "" => Array [
10270 Symbol(OK),
10271 Symbol(OK),
10272 ],
10273 },
10274 "dep": "[email protected]",
10275 "edge": "{ node_modules/y peer d@1 }",
10276 "parent": "y",
10277 "placed": "node_modules/d",
10278 },
10279 Object {
10280 "canPlace": Symbol(REPLACE),
10281 "canPlaceSelf": Symbol(REPLACE),
10282 "checks": Map {
10283 "" => Array [
10284 Symbol(OK),
10285 Symbol(OK),
10286 ],
10287 },
10288 "dep": "[email protected]",
10289 "edge": "{ node_modules/d peer e@1 }",
10290 "parent": "d",
10291 "placed": "node_modules/e",
10292 },
10293 Object {
10294 "canPlace": Symbol(REPLACE),
10295 "canPlaceSelf": Symbol(REPLACE),
10296 "checks": Map {
10297 "" => Array [
10298 Symbol(OK),
10299 Symbol(OK),
10300 ],
10301 },
10302 "dep": "[email protected]",
10303 "edge": "{ node_modules/e peer a@1 }",
10304 "parent": "e",
10305 "placed": "node_modules/a",
10306 },
10307 Object {
10308 "canPlace": Symbol(OK),
10309 "canPlaceSelf": Symbol(OK),
10310 "checks": Map {
10311 "" => Array [
10312 Symbol(OK),
10313 Symbol(OK),
10314 ],
10315 },
10316 "dep": "[email protected]",
10317 "edge": "{ node_modules/a peer b@1 }",
10318 "parent": "a",
10319 "placed": "node_modules/b",
10320 },
10321 Object {
10322 "canPlace": Symbol(OK),
10323 "canPlaceSelf": Symbol(OK),
10324 "checks": Map {
10325 "" => Array [
10326 Symbol(OK),
10327 Symbol(OK),
10328 ],
10329 },
10330 "dep": "[email protected]",
10331 "edge": "{ node_modules/b peer c@1 }",
10332 "parent": "b",
10333 "placed": "node_modules/c",
10334 },
10335 ]
10336 `
10337
10338 exports[`test/place-dep.js TAP placement tests replacing partially overlapping peer sets, superset > warnings 1`] = `
10339 Array [
10340 Array [
10341 "ERESOLVE",
10342 "overriding peer dependency",
10343 Object {
10344 "code": "ERESOLVE",
10345 "current": Object {
10346 "dependents": Array [
10347 Object {
10348 "from": Object {
10349 "name": "c",
10350 "version": "2.0.0",
10351 },
10352 "name": "e",
10353 "spec": "2",
10354 "type": "peer",
10355 },
10356 ],
10357 "isWorkspace": false,
10358 "location": "node_modules/e",
10359 "name": "e",
10360 "version": "2.0.0",
10361 },
10362 "dep": Object {
10363 "dependents": Array [
10364 Object {
10365 "from": Object {
10366 "dependents": Array [
10367 Object {
10368 "from": Object {
10369 "dependents": Array [
10370 Object {
10371 "from": Object {
10372 "dependents": Array [
10373 Object {
10374 "from": Object {
10375 "location": "/some/path",
10376 },
10377 "name": "v",
10378 "spec": "4",
10379 "type": "prod",
10380 },
10381 ],
10382 "isWorkspace": false,
10383 "location": "node_modules/v",
10384 "name": "v",
10385 "version": "4.0.0",
10386 },
10387 "name": "a",
10388 "spec": "1||2",
10389 "type": "peer",
10390 },
10391 Object {
10392 "from": Object {
10393 "dependents": Array [
10394 Object {
10395 "from": Object {
10396 "name": "c",
10397 "version": "2.0.0",
10398 },
10399 "name": "e",
10400 "spec": "2",
10401 "type": "peer",
10402 },
10403 ],
10404 "isWorkspace": false,
10405 "location": "node_modules/e",
10406 "name": "e",
10407 "version": "2.0.0",
10408 },
10409 "name": "a",
10410 "spec": "2",
10411 "type": "peer",
10412 },
10413 ],
10414 "isWorkspace": false,
10415 "location": "node_modules/a",
10416 "name": "a",
10417 "version": "2.0.0",
10418 },
10419 "name": "c",
10420 "spec": "2",
10421 "type": "peer",
10422 },
10423 ],
10424 "isWorkspace": false,
10425 "location": "node_modules/c",
10426 "name": "c",
10427 "version": "2.0.0",
10428 },
10429 "name": "e",
10430 "spec": "2",
10431 "type": "peer",
10432 },
10433 ],
10434 "isWorkspace": false,
10435 "location": "node_modules/e",
10436 "name": "e",
10437 "version": "1.0.0",
10438 "whileInstalling": Object {
10439 "name": undefined,
10440 "path": "/some/path",
10441 "version": undefined,
10442 },
10443 },
10444 "edge": Object {
10445 "from": Object {
10446 "dependents": Array [
10447 Object {
10448 "from": Object {
10449 "dependents": Array [
10450 Object {
10451 "from": Object {
10452 "dependents": Array [
10453 Object {
10454 "from": Object {
10455 "location": "/some/path",
10456 },
10457 "name": "v",
10458 "spec": "4",
10459 "type": "prod",
10460 },
10461 ],
10462 "isWorkspace": false,
10463 "location": "node_modules/v",
10464 "name": "v",
10465 "version": "4.0.0",
10466 },
10467 "name": "a",
10468 "spec": "1||2",
10469 "type": "peer",
10470 },
10471 Object {
10472 "from": Object {
10473 "dependents": Array [
10474 Object {
10475 "from": Object {
10476 "name": "c",
10477 "version": "2.0.0",
10478 },
10479 "name": "e",
10480 "spec": "2",
10481 "type": "peer",
10482 },
10483 ],
10484 "isWorkspace": false,
10485 "location": "node_modules/e",
10486 "name": "e",
10487 "version": "2.0.0",
10488 },
10489 "name": "a",
10490 "spec": "2",
10491 "type": "peer",
10492 },
10493 ],
10494 "isWorkspace": false,
10495 "location": "node_modules/a",
10496 "name": "a",
10497 "version": "2.0.0",
10498 },
10499 "name": "c",
10500 "spec": "2",
10501 "type": "peer",
10502 },
10503 ],
10504 "isWorkspace": false,
10505 "location": "node_modules/c",
10506 "name": "c",
10507 "version": "2.0.0",
10508 },
10509 "name": "e",
10510 "spec": "2",
10511 "type": "peer",
10512 },
10513 "force": false,
10514 "isMine": true,
10515 "peerConflict": Object {
10516 "dependents": Array [
10517 Object {
10518 "from": Object {
10519 "name": "c",
10520 "version": "2.0.0",
10521 },
10522 "name": "e",
10523 "spec": "2",
10524 "type": "peer",
10525 },
10526 ],
10527 "isWorkspace": false,
10528 "location": "node_modules/e",
10529 "name": "e",
10530 "version": "2.0.0",
10531 },
10532 "strictPeerDeps": false,
10533 },
10534 ],
10535 ]
10536 `
10537
10538 exports[`test/place-dep.js TAP placement tests skip over peer dependents in the ancestry walkup > changes to tree 1`] = `
10539 --- expected
10540 +++ actual
10541 @@ -68,8 +68,7 @@
10542 "type": "peer",
10543 "name": "v",
10544 "spec": "*",
10545 - "to": null,
10546 - "error": "MISSING",
10547 + "to": "node_modules/v",
10548 },
10549 },
10550 "edgesIn": Set {
10551 @@ -95,8 +94,7 @@
10552 "type": "prod",
10553 "name": "v",
10554 "spec": "1",
10555 - "to": null,
10556 - "error": "MISSING",
10557 + "to": "node_modules/v",
10558 },
10559 },
10560 "edgesIn": Set {
10561 @@ -128,5 +126,29 @@
10562 },
10563 },
10564 },
10565 + "v" => ArboristNode {
10566 + "name": "v",
10567 + "version": "1.0.0",
10568 + "location": "node_modules/v",
10569 + "path": "/some/path/node_modules/v",
10570 + "extraneous": true,
10571 + "dev": true,
10572 + "optional": true,
10573 + "peer": true,
10574 + "edgesIn": Set {
10575 + EdgeIn {
10576 + "type": "peer",
10577 + "name": "v",
10578 + "spec": "*",
10579 + "from": "node_modules/b",
10580 + },
10581 + EdgeIn {
10582 + "type": "prod",
10583 + "name": "v",
10584 + "spec": "1",
10585 + "from": "node_modules/b/node_modules/c",
10586 + },
10587 + },
10588 + },
10589 },
10590 }
10591
10592 `
10593
10594 exports[`test/place-dep.js TAP placement tests skip over peer dependents in the ancestry walkup > placements 1`] = `
10595 Array [
10596 Object {
10597 "canPlace": Symbol(OK),
10598 "canPlaceSelf": Symbol(OK),
10599 "checks": Map {
10600 "node_modules/b/node_modules/c" => Array [
10601 Symbol(OK),
10602 Symbol(OK),
10603 ],
10604 "" => Array [
10605 Symbol(OK),
10606 Symbol(OK),
10607 ],
10608 },
10609 "dep": "[email protected]",
10610 "edge": "{ node_modules/b/node_modules/c prod v@1 }",
10611 "placed": "node_modules/v",
10612 },
10613 ]
10614 `
10615
10616 exports[`test/place-dep.js TAP placement tests skip over peer dependents in the ancestry walkup > warnings 1`] = `
10617 Array []
10618 `
10619
10620 exports[`test/place-dep.js TAP placement tests upgrade a transitive dependency > changes to tree 1`] = `
10621 --- expected
10622 +++ actual
10623
10624 `
10625
10626 exports[`test/place-dep.js TAP placement tests upgrade a transitive dependency > placements 1`] = `
10627 Array [
10628 Object {
10629 "canPlace": null,
10630 "canPlaceSelf": null,
10631 "checks": Map {},
10632 "dep": "[email protected]",
10633 "edge": "{ node_modules/foo prod bar@1 }",
10634 "placed": null,
10635 },
10636 ]
10637 `
10638
10639 exports[`test/place-dep.js TAP placement tests upgrade a transitive dependency > warnings 1`] = `
10640 Array []
10641 `
10642
10643 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep > changes to tree 1`] = `
10644 --- expected
10645 +++ actual
10646 @@ -62,8 +62,7 @@
10647 "type": "prod",
10648 "name": "b",
10649 "spec": "2",
10650 - "to": null,
10651 - "error": "MISSING",
10652 + "to": "node_modules/v/node_modules/b",
10653 },
10654 "y" => EdgeOut {
10655 "type": "peer",
10656 @@ -80,6 +79,62 @@
10657 "from": "",
10658 },
10659 },
10660 + "children": Map {
10661 + "b" => ArboristNode {
10662 + "name": "b",
10663 + "version": "2.0.0",
10664 + "location": "node_modules/v/node_modules/b",
10665 + "path": "/some/path/node_modules/v/node_modules/b",
10666 + "extraneous": true,
10667 + "dev": true,
10668 + "optional": true,
10669 + "peer": true,
10670 + "edgesOut": Map {
10671 + "k" => EdgeOut {
10672 + "type": "peer",
10673 + "name": "k",
10674 + "spec": "2",
10675 + "to": "node_modules/v/node_modules/k",
10676 + },
10677 + },
10678 + "edgesIn": Set {
10679 + EdgeIn {
10680 + "type": "prod",
10681 + "name": "b",
10682 + "spec": "2",
10683 + "from": "node_modules/v",
10684 + },
10685 + },
10686 + },
10687 + "k" => ArboristNode {
10688 + "name": "k",
10689 + "version": "2.0.0",
10690 + "location": "node_modules/v/node_modules/k",
10691 + "path": "/some/path/node_modules/v/node_modules/k",
10692 + "extraneous": true,
10693 + "dev": true,
10694 + "optional": true,
10695 + "peer": true,
10696 + "edgesOut": Map {
10697 + "y" => EdgeOut {
10698 + "type": "peer",
10699 + "name": "y",
10700 + "spec": "2",
10701 + "error": "INVALID",
10702 + "peerConflicted": true,
10703 + "to": "node_modules/y",
10704 + },
10705 + },
10706 + "edgesIn": Set {
10707 + EdgeIn {
10708 + "type": "peer",
10709 + "name": "k",
10710 + "spec": "2",
10711 + "from": "node_modules/v/node_modules/b",
10712 + },
10713 + },
10714 + },
10715 + },
10716 },
10717 "x" => ArboristNode {
10718 "name": "x",
10719 @@ -126,6 +181,14 @@
10720 EdgeIn {
10721 "type": "peer",
10722 "name": "y",
10723 + "spec": "2",
10724 + "error": "INVALID",
10725 + "peerConflicted": true,
10726 + "from": "node_modules/v/node_modules/k",
10727 + },
10728 + EdgeIn {
10729 + "type": "peer",
10730 + "name": "y",
10731 "spec": "1",
10732 "from": "node_modules/x",
10733 },
10734
10735 `
10736
10737 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep > placements 1`] = `
10738 Array [
10739 Object {
10740 "canPlace": Symbol(CONFLICT),
10741 "canPlaceSelf": Symbol(OK),
10742 "checks": Map {
10743 "node_modules/v" => Array [
10744 Symbol(CONFLICT),
10745 Symbol(OK),
10746 ],
10747 },
10748 "dep": "[email protected]",
10749 "edge": "{ node_modules/v prod b@2 }",
10750 "placed": "node_modules/v/node_modules/b",
10751 },
10752 Object {
10753 "canPlace": Symbol(CONFLICT),
10754 "canPlaceSelf": Symbol(OK),
10755 "checks": Map {
10756 "node_modules/v" => Array [
10757 Symbol(CONFLICT),
10758 Symbol(OK),
10759 ],
10760 },
10761 "dep": "[email protected]",
10762 "edge": "{ node_modules/v/node_modules/b peer k@2 }",
10763 "parent": "b",
10764 "placed": "node_modules/v/node_modules/k",
10765 },
10766 Object {
10767 "canPlace": null,
10768 "canPlaceSelf": null,
10769 "checks": Map {
10770 "node_modules/v" => Array [
10771 Symbol(CONFLICT),
10772 Symbol(OK),
10773 ],
10774 },
10775 "dep": "[email protected]",
10776 "edge": "{ node_modules/v/node_modules/k peer y@2 }",
10777 "parent": "k",
10778 "placed": null,
10779 },
10780 ]
10781 `
10782
10783 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep > warnings 1`] = `
10784 Array [
10785 Array [
10786 "ERESOLVE",
10787 "overriding peer dependency",
10788 Object {
10789 "code": "ERESOLVE",
10790 "current": Object {
10791 "dependents": Array [
10792 Object {
10793 "error": "INVALID",
10794 "from": Object {
10795 "dependents": Array [
10796 Object {
10797 "from": Object {
10798 "dependents": Array [
10799 Object {
10800 "from": Object {
10801 "dependents": Array [
10802 Object {
10803 "from": Object {
10804 "location": "/some/path",
10805 },
10806 "name": "v",
10807 "spec": "",
10808 "type": "prod",
10809 },
10810 ],
10811 "isWorkspace": false,
10812 "location": "node_modules/v",
10813 "name": "v",
10814 "version": "1.0.0",
10815 },
10816 "name": "b",
10817 "spec": "2",
10818 "type": "prod",
10819 },
10820 ],
10821 "isWorkspace": false,
10822 "location": "node_modules/v/node_modules/b",
10823 "name": "b",
10824 "version": "2.0.0",
10825 },
10826 "name": "k",
10827 "spec": "2",
10828 "type": "peer",
10829 },
10830 ],
10831 "isWorkspace": false,
10832 "location": "node_modules/v/node_modules/k",
10833 "name": "k",
10834 "version": "2.0.0",
10835 },
10836 "name": "y",
10837 "spec": "2",
10838 "type": "peer",
10839 },
10840 ],
10841 "isWorkspace": false,
10842 "location": "node_modules/y",
10843 "name": "y",
10844 "version": "1.0.0",
10845 },
10846 "dep": Object {
10847 "dependents": Array [
10848 Object {
10849 "error": "INVALID",
10850 "from": Object {
10851 "dependents": Array [
10852 Object {
10853 "from": Object {
10854 "dependents": Array [
10855 Object {
10856 "from": Object {
10857 "dependents": Array [
10858 Object {
10859 "from": Object {
10860 "location": "/some/path",
10861 },
10862 "name": "v",
10863 "spec": "",
10864 "type": "prod",
10865 },
10866 ],
10867 "isWorkspace": false,
10868 "location": "node_modules/v",
10869 "name": "v",
10870 "version": "1.0.0",
10871 },
10872 "name": "b",
10873 "spec": "2",
10874 "type": "prod",
10875 },
10876 ],
10877 "isWorkspace": false,
10878 "location": "node_modules/v/node_modules/b",
10879 "name": "b",
10880 "version": "2.0.0",
10881 },
10882 "name": "k",
10883 "spec": "2",
10884 "type": "peer",
10885 },
10886 ],
10887 "isWorkspace": false,
10888 "location": "node_modules/v/node_modules/k",
10889 "name": "k",
10890 "version": "2.0.0",
10891 },
10892 "name": "y",
10893 "spec": "2",
10894 "type": "peer",
10895 },
10896 ],
10897 "isWorkspace": false,
10898 "location": "node_modules/y",
10899 "name": "y",
10900 "version": "2.0.0",
10901 "whileInstalling": Object {
10902 "name": "v",
10903 "path": "/some/path/node_modules/v",
10904 "version": "1.0.0",
10905 },
10906 },
10907 "edge": Object {
10908 "error": "INVALID",
10909 "from": Object {
10910 "dependents": Array [
10911 Object {
10912 "from": Object {
10913 "dependents": Array [
10914 Object {
10915 "from": Object {
10916 "dependents": Array [
10917 Object {
10918 "from": Object {
10919 "location": "/some/path",
10920 },
10921 "name": "v",
10922 "spec": "",
10923 "type": "prod",
10924 },
10925 ],
10926 "isWorkspace": false,
10927 "location": "node_modules/v",
10928 "name": "v",
10929 "version": "1.0.0",
10930 },
10931 "name": "b",
10932 "spec": "2",
10933 "type": "prod",
10934 },
10935 ],
10936 "isWorkspace": false,
10937 "location": "node_modules/v/node_modules/b",
10938 "name": "b",
10939 "version": "2.0.0",
10940 },
10941 "name": "k",
10942 "spec": "2",
10943 "type": "peer",
10944 },
10945 ],
10946 "isWorkspace": false,
10947 "location": "node_modules/v/node_modules/k",
10948 "name": "k",
10949 "version": "2.0.0",
10950 },
10951 "name": "y",
10952 "spec": "2",
10953 "type": "peer",
10954 },
10955 "force": false,
10956 "isMine": false,
10957 "peerConflict": Object {
10958 "dependents": Array [
10959 Object {
10960 "error": "INVALID",
10961 "from": Object {
10962 "dependents": Array [
10963 Object {
10964 "from": Object {
10965 "dependents": Array [
10966 Object {
10967 "from": Object {
10968 "dependents": Array [
10969 Object {
10970 "from": Object {
10971 "location": "/some/path",
10972 },
10973 "name": "v",
10974 "spec": "",
10975 "type": "prod",
10976 },
10977 ],
10978 "isWorkspace": false,
10979 "location": "node_modules/v",
10980 "name": "v",
10981 "version": "1.0.0",
10982 },
10983 "name": "b",
10984 "spec": "2",
10985 "type": "prod",
10986 },
10987 ],
10988 "isWorkspace": false,
10989 "location": "node_modules/v/node_modules/b",
10990 "name": "b",
10991 "version": "2.0.0",
10992 },
10993 "name": "k",
10994 "spec": "2",
10995 "type": "peer",
10996 },
10997 ],
10998 "isWorkspace": false,
10999 "location": "node_modules/v/node_modules/k",
11000 "name": "k",
11001 "version": "2.0.0",
11002 },
11003 "name": "y",
11004 "spec": "2",
11005 "type": "peer",
11006 },
11007 ],
11008 "isWorkspace": false,
11009 "location": "node_modules/y",
11010 "name": "y",
11011 "version": "1.0.0",
11012 },
11013 "strictPeerDeps": false,
11014 },
11015 ],
11016 ]
11017 `
11018
11019 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2 > changes to tree 1`] = `
11020 --- expected
11021 +++ actual
11022 @@ -83,6 +83,7 @@
11023 "name": "y",
11024 "spec": "2",
11025 "error": "INVALID",
11026 + "peerConflicted": true,
11027 "to": "node_modules/y",
11028 },
11029 },
11030 @@ -172,6 +173,14 @@
11031 EdgeIn {
11032 "type": "peer",
11033 "name": "y",
11034 + "spec": "2",
11035 + "error": "INVALID",
11036 + "peerConflicted": true,
11037 + "from": "node_modules/k",
11038 + },
11039 + EdgeIn {
11040 + "type": "peer",
11041 + "name": "y",
11042 "spec": "*",
11043 "from": "node_modules/v",
11044 },
11045 @@ -181,13 +190,6 @@
11046 "spec": "1",
11047 "from": "node_modules/x",
11048 },
11049 - EdgeIn {
11050 - "type": "peer",
11051 - "name": "y",
11052 - "spec": "2",
11053 - "error": "INVALID",
11054 - "from": "node_modules/k",
11055 - },
11056 },
11057 },
11058 },
11059
11060 `
11061
11062 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2 > placements 1`] = `
11063 Array [
11064 Object {
11065 "canPlace": null,
11066 "canPlaceSelf": null,
11067 "checks": Map {
11068 "" => Array [
11069 Symbol(CONFLICT),
11070 Symbol(CONFLICT),
11071 ],
11072 },
11073 "dep": "[email protected]",
11074 "edge": "{ node_modules/k peer y@2 }",
11075 "placed": null,
11076 },
11077 ]
11078 `
11079
11080 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2 > warnings 1`] = `
11081 Array [
11082 Array [
11083 "ERESOLVE",
11084 "overriding peer dependency",
11085 Object {
11086 "code": "ERESOLVE",
11087 "current": Object {
11088 "dependents": Array [
11089 Object {
11090 "from": Object {
11091 "dependents": Array [
11092 Object {
11093 "from": Object {
11094 "location": "/some/path",
11095 },
11096 "name": "v",
11097 "spec": "",
11098 "type": "prod",
11099 },
11100 ],
11101 "isWorkspace": false,
11102 "location": "node_modules/v",
11103 "name": "v",
11104 "version": "1.0.0",
11105 },
11106 "name": "y",
11107 "spec": "",
11108 "type": "peer",
11109 },
11110 Object {
11111 "from": Object {
11112 "dependents": Array [
11113 Object {
11114 "from": Object {
11115 "dependents": Array [
11116 Object {
11117 "from": Object {
11118 "dependents": Array [
11119 Object {
11120 "from": Object {
11121 "location": "/some/path",
11122 },
11123 "name": "v",
11124 "spec": "",
11125 "type": "prod",
11126 },
11127 ],
11128 "isWorkspace": false,
11129 "location": "node_modules/v",
11130 "name": "v",
11131 "version": "1.0.0",
11132 },
11133 "name": "a",
11134 "spec": "1",
11135 "type": "prod",
11136 },
11137 ],
11138 "isWorkspace": false,
11139 "location": "node_modules/a",
11140 "name": "a",
11141 "version": "1.0.0",
11142 },
11143 "name": "x",
11144 "spec": "1",
11145 "type": "peer",
11146 },
11147 ],
11148 "isWorkspace": false,
11149 "location": "node_modules/x",
11150 "name": "x",
11151 "version": "1.0.0",
11152 },
11153 "name": "y",
11154 "spec": "1",
11155 "type": "peer",
11156 },
11157 ],
11158 "isWorkspace": false,
11159 "location": "node_modules/y",
11160 "name": "y",
11161 "version": "1.0.0",
11162 },
11163 "dep": Object {
11164 "dependents": Array [
11165 Object {
11166 "error": "INVALID",
11167 "from": Object {
11168 "dependents": Array [
11169 Object {
11170 "from": Object {
11171 "dependents": Array [
11172 Object {
11173 "from": Object {
11174 "dependents": Array [
11175 Object {
11176 "from": Object {
11177 "location": "/some/path",
11178 },
11179 "name": "v",
11180 "spec": "",
11181 "type": "prod",
11182 },
11183 ],
11184 "isWorkspace": false,
11185 "location": "node_modules/v",
11186 "name": "v",
11187 "version": "1.0.0",
11188 },
11189 "name": "b",
11190 "spec": "2",
11191 "type": "prod",
11192 },
11193 ],
11194 "isWorkspace": false,
11195 "location": "node_modules/b",
11196 "name": "b",
11197 "version": "2.0.0",
11198 },
11199 "name": "k",
11200 "spec": "2",
11201 "type": "peer",
11202 },
11203 ],
11204 "isWorkspace": false,
11205 "location": "node_modules/k",
11206 "name": "k",
11207 "version": "2.0.0",
11208 },
11209 "name": "y",
11210 "spec": "2",
11211 "type": "peer",
11212 },
11213 ],
11214 "isWorkspace": false,
11215 "location": "node_modules/y",
11216 "name": "y",
11217 "version": "2.0.0",
11218 "whileInstalling": Object {
11219 "name": "k",
11220 "path": "/some/path/node_modules/k",
11221 "version": "2.0.0",
11222 },
11223 },
11224 "edge": Object {
11225 "error": "INVALID",
11226 "from": Object {
11227 "dependents": Array [
11228 Object {
11229 "from": Object {
11230 "dependents": Array [
11231 Object {
11232 "from": Object {
11233 "dependents": Array [
11234 Object {
11235 "from": Object {
11236 "location": "/some/path",
11237 },
11238 "name": "v",
11239 "spec": "",
11240 "type": "prod",
11241 },
11242 ],
11243 "isWorkspace": false,
11244 "location": "node_modules/v",
11245 "name": "v",
11246 "version": "1.0.0",
11247 },
11248 "name": "b",
11249 "spec": "2",
11250 "type": "prod",
11251 },
11252 ],
11253 "isWorkspace": false,
11254 "location": "node_modules/b",
11255 "name": "b",
11256 "version": "2.0.0",
11257 },
11258 "name": "k",
11259 "spec": "2",
11260 "type": "peer",
11261 },
11262 ],
11263 "isWorkspace": false,
11264 "location": "node_modules/k",
11265 "name": "k",
11266 "version": "2.0.0",
11267 },
11268 "name": "y",
11269 "spec": "2",
11270 "type": "peer",
11271 },
11272 "force": false,
11273 "isMine": false,
11274 "peerConflict": Object {
11275 "current": Object {
11276 "dependents": Array [
11277 Object {
11278 "from": Object {
11279 "dependents": Array [
11280 Object {
11281 "from": Object {
11282 "location": "/some/path",
11283 },
11284 "name": "v",
11285 "spec": "",
11286 "type": "prod",
11287 },
11288 ],
11289 "isWorkspace": false,
11290 "location": "node_modules/v",
11291 "name": "v",
11292 "version": "1.0.0",
11293 },
11294 "name": "y",
11295 "spec": "",
11296 "type": "peer",
11297 },
11298 Object {
11299 "from": Object {
11300 "dependents": Array [
11301 Object {
11302 "from": Object {
11303 "dependents": Array [
11304 Object {
11305 "from": Object {
11306 "dependents": Array [
11307 Object {
11308 "from": Object {
11309 "location": "/some/path",
11310 },
11311 "name": "v",
11312 "spec": "",
11313 "type": "prod",
11314 },
11315 ],
11316 "isWorkspace": false,
11317 "location": "node_modules/v",
11318 "name": "v",
11319 "version": "1.0.0",
11320 },
11321 "name": "a",
11322 "spec": "1",
11323 "type": "prod",
11324 },
11325 ],
11326 "isWorkspace": false,
11327 "location": "node_modules/a",
11328 "name": "a",
11329 "version": "1.0.0",
11330 },
11331 "name": "x",
11332 "spec": "1",
11333 "type": "peer",
11334 },
11335 ],
11336 "isWorkspace": false,
11337 "location": "node_modules/x",
11338 "name": "x",
11339 "version": "1.0.0",
11340 },
11341 "name": "y",
11342 "spec": "1",
11343 "type": "peer",
11344 },
11345 ],
11346 "isWorkspace": false,
11347 "location": "node_modules/y",
11348 "name": "y",
11349 "version": "1.0.0",
11350 },
11351 "peer": Object {
11352 "dependents": Array [
11353 Object {
11354 "error": "INVALID",
11355 "from": Object {
11356 "dependents": Array [
11357 Object {
11358 "from": Object {
11359 "dependents": Array [
11360 Object {
11361 "from": Object {
11362 "dependents": Array [
11363 Object {
11364 "from": Object {
11365 "location": "/some/path",
11366 },
11367 "name": "v",
11368 "spec": "",
11369 "type": "prod",
11370 },
11371 ],
11372 "isWorkspace": false,
11373 "location": "node_modules/v",
11374 "name": "v",
11375 "version": "1.0.0",
11376 },
11377 "name": "b",
11378 "spec": "2",
11379 "type": "prod",
11380 },
11381 ],
11382 "isWorkspace": false,
11383 "location": "node_modules/b",
11384 "name": "b",
11385 "version": "2.0.0",
11386 },
11387 "name": "k",
11388 "spec": "2",
11389 "type": "peer",
11390 },
11391 ],
11392 "isWorkspace": false,
11393 "location": "node_modules/k",
11394 "name": "k",
11395 "version": "2.0.0",
11396 },
11397 "name": "y",
11398 "spec": "2",
11399 "type": "peer",
11400 },
11401 ],
11402 "isWorkspace": false,
11403 "location": "node_modules/y",
11404 "name": "y",
11405 "version": "2.0.0",
11406 "whileInstalling": Object {
11407 "name": "k",
11408 "path": "/some/path/node_modules/k",
11409 "version": "2.0.0",
11410 },
11411 },
11412 },
11413 "strictPeerDeps": false,
11414 },
11415 ],
11416 ]
11417 `
11418
11419 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, but with override > changes to tree 1`] = `
11420 --- expected
11421 +++ actual
11422
11423 `
11424
11425 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, but with override > placements 1`] = `
11426 Array [
11427 Object {
11428 "canPlace": Symbol(KEEP),
11429 "canPlaceSelf": Symbol(KEEP),
11430 "checks": Map {
11431 "" => Array [
11432 Symbol(KEEP),
11433 Symbol(KEEP),
11434 ],
11435 },
11436 "dep": "[email protected]",
11437 "edge": "{ node_modules/k peer y@2 }",
11438 "placed": null,
11439 },
11440 ]
11441 `
11442
11443 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, but with override > warnings 1`] = `
11444 Array [
11445 Array [
11446 "ERESOLVE",
11447 "overriding peer dependency",
11448 Object {
11449 "code": "ERESOLVE",
11450 "current": Object {
11451 "dependents": Array [
11452 Object {
11453 "from": Object {
11454 "dependents": Array [
11455 Object {
11456 "from": Object {
11457 "location": "/some/path",
11458 },
11459 "name": "v",
11460 "spec": "",
11461 "type": "prod",
11462 },
11463 ],
11464 "isWorkspace": false,
11465 "location": "node_modules/v",
11466 "name": "v",
11467 "version": "1.0.0",
11468 },
11469 "name": "y",
11470 "spec": "",
11471 "type": "peer",
11472 },
11473 Object {
11474 "from": Object {
11475 "dependents": Array [
11476 Object {
11477 "from": Object {
11478 "dependents": Array [
11479 Object {
11480 "from": Object {
11481 "dependents": Array [
11482 Object {
11483 "from": Object {
11484 "location": "/some/path",
11485 },
11486 "name": "v",
11487 "spec": "",
11488 "type": "prod",
11489 },
11490 ],
11491 "isWorkspace": false,
11492 "location": "node_modules/v",
11493 "name": "v",
11494 "version": "1.0.0",
11495 },
11496 "name": "a",
11497 "spec": "1",
11498 "type": "prod",
11499 },
11500 ],
11501 "isWorkspace": false,
11502 "location": "node_modules/a",
11503 "name": "a",
11504 "version": "1.0.0",
11505 },
11506 "name": "x",
11507 "spec": "1",
11508 "type": "peer",
11509 },
11510 ],
11511 "isWorkspace": false,
11512 "location": "node_modules/x",
11513 "name": "x",
11514 "version": "1.0.0",
11515 },
11516 "name": "y",
11517 "spec": "1",
11518 "type": "peer",
11519 },
11520 ],
11521 "isWorkspace": false,
11522 "location": "node_modules/y",
11523 "name": "y",
11524 "version": "1.0.0",
11525 },
11526 "dep": Object {
11527 "dependents": Array [
11528 Object {
11529 "error": "INVALID",
11530 "from": Object {
11531 "dependents": Array [
11532 Object {
11533 "from": Object {
11534 "dependents": Array [
11535 Object {
11536 "from": Object {
11537 "dependents": Array [
11538 Object {
11539 "from": Object {
11540 "location": "/some/path",
11541 },
11542 "name": "v",
11543 "spec": "",
11544 "type": "prod",
11545 },
11546 ],
11547 "isWorkspace": false,
11548 "location": "node_modules/v",
11549 "name": "v",
11550 "version": "1.0.0",
11551 },
11552 "name": "b",
11553 "spec": "2",
11554 "type": "prod",
11555 },
11556 ],
11557 "isWorkspace": false,
11558 "location": "node_modules/b",
11559 "name": "b",
11560 "version": "2.0.0",
11561 },
11562 "name": "k",
11563 "spec": "2",
11564 "type": "peer",
11565 },
11566 ],
11567 "isWorkspace": false,
11568 "location": "node_modules/k",
11569 "name": "k",
11570 "version": "2.0.0",
11571 },
11572 "name": "y",
11573 "spec": "2",
11574 "type": "peer",
11575 },
11576 ],
11577 "isWorkspace": false,
11578 "location": "node_modules/y",
11579 "name": "y",
11580 "version": "1.0.0",
11581 "whileInstalling": Object {
11582 "name": "k",
11583 "path": "/some/path/node_modules/k",
11584 "version": "2.0.0",
11585 },
11586 },
11587 "edge": Object {
11588 "error": "INVALID",
11589 "from": Object {
11590 "dependents": Array [
11591 Object {
11592 "from": Object {
11593 "dependents": Array [
11594 Object {
11595 "from": Object {
11596 "dependents": Array [
11597 Object {
11598 "from": Object {
11599 "location": "/some/path",
11600 },
11601 "name": "v",
11602 "spec": "",
11603 "type": "prod",
11604 },
11605 ],
11606 "isWorkspace": false,
11607 "location": "node_modules/v",
11608 "name": "v",
11609 "version": "1.0.0",
11610 },
11611 "name": "b",
11612 "spec": "2",
11613 "type": "prod",
11614 },
11615 ],
11616 "isWorkspace": false,
11617 "location": "node_modules/b",
11618 "name": "b",
11619 "version": "2.0.0",
11620 },
11621 "name": "k",
11622 "spec": "2",
11623 "type": "peer",
11624 },
11625 ],
11626 "isWorkspace": false,
11627 "location": "node_modules/k",
11628 "name": "k",
11629 "version": "2.0.0",
11630 },
11631 "name": "y",
11632 "spec": "2",
11633 "type": "peer",
11634 },
11635 "force": false,
11636 "isMine": false,
11637 "strictPeerDeps": false,
11638 },
11639 ],
11640 ]
11641 `
11642
11643 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, override, no current > changes to tree 1`] = `
11644 --- expected
11645 +++ actual
11646 @@ -114,9 +114,9 @@
11647 "type": "peer",
11648 "name": "y",
11649 "spec": "2",
11650 - "error": "MISSING",
11651 + "error": "INVALID",
11652 "peerConflicted": true,
11653 - "to": null,
11654 + "to": "node_modules/y",
11655 },
11656 },
11657 "edgesIn": Set {
11658 @@ -160,8 +160,7 @@
11659 "type": "peer",
11660 "name": "y",
11661 "spec": "*",
11662 - "to": null,
11663 - "error": "MISSING",
11664 + "to": "node_modules/y",
11665 },
11666 },
11667 "edgesIn": Set {
11668 @@ -187,8 +186,7 @@
11669 "type": "peer",
11670 "name": "y",
11671 "spec": "1",
11672 - "to": null,
11673 - "error": "MISSING",
11674 + "to": "node_modules/y",
11675 },
11676 },
11677 "edgesIn": Set {
11678 @@ -200,5 +198,37 @@
11679 },
11680 },
11681 },
11682 + "y" => ArboristNode {
11683 + "name": "y",
11684 + "version": "1.0.0",
11685 + "location": "node_modules/y",
11686 + "path": "/some/path/node_modules/y",
11687 + "extraneous": true,
11688 + "dev": true,
11689 + "optional": true,
11690 + "peer": true,
11691 + "edgesIn": Set {
11692 + EdgeIn {
11693 + "type": "peer",
11694 + "name": "y",
11695 + "spec": "2",
11696 + "error": "INVALID",
11697 + "peerConflicted": true,
11698 + "from": "node_modules/k",
11699 + },
11700 + EdgeIn {
11701 + "type": "peer",
11702 + "name": "y",
11703 + "spec": "*",
11704 + "from": "node_modules/v",
11705 + },
11706 + EdgeIn {
11707 + "type": "peer",
11708 + "name": "y",
11709 + "spec": "1",
11710 + "from": "node_modules/x",
11711 + },
11712 + },
11713 + },
11714 },
11715 }
11716
11717 `
11718
11719 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, override, no current > placements 1`] = `
11720 Array [
11721 Object {
11722 "canPlace": Symbol(OK),
11723 "canPlaceSelf": Symbol(OK),
11724 "checks": Map {
11725 "" => Array [
11726 Symbol(OK),
11727 Symbol(OK),
11728 ],
11729 },
11730 "dep": "[email protected]",
11731 "edge": "{ node_modules/k peer y@2 }",
11732 "placed": "node_modules/y",
11733 },
11734 ]
11735 `
11736
11737 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on deep peer dep, step 2, override, no current > warnings 1`] = `
11738 Array [
11739 Array [
11740 "ERESOLVE",
11741 "overriding peer dependency",
11742 Object {
11743 "code": "ERESOLVE",
11744 "current": Object {
11745 "dependents": Array [
11746 Object {
11747 "from": Object {
11748 "dependents": Array [
11749 Object {
11750 "from": Object {
11751 "location": "/some/path",
11752 },
11753 "name": "v",
11754 "spec": "",
11755 "type": "prod",
11756 },
11757 ],
11758 "isWorkspace": false,
11759 "location": "node_modules/v",
11760 "name": "v",
11761 "version": "1.0.0",
11762 },
11763 "name": "y",
11764 "spec": "",
11765 "type": "peer",
11766 },
11767 Object {
11768 "from": Object {
11769 "dependents": Array [
11770 Object {
11771 "from": Object {
11772 "dependents": Array [
11773 Object {
11774 "from": Object {
11775 "dependents": Array [
11776 Object {
11777 "from": Object {
11778 "location": "/some/path",
11779 },
11780 "name": "v",
11781 "spec": "",
11782 "type": "prod",
11783 },
11784 ],
11785 "isWorkspace": false,
11786 "location": "node_modules/v",
11787 "name": "v",
11788 "version": "1.0.0",
11789 },
11790 "name": "a",
11791 "spec": "1",
11792 "type": "prod",
11793 },
11794 ],
11795 "isWorkspace": false,
11796 "location": "node_modules/a",
11797 "name": "a",
11798 "version": "1.0.0",
11799 },
11800 "name": "x",
11801 "spec": "1",
11802 "type": "peer",
11803 },
11804 ],
11805 "isWorkspace": false,
11806 "location": "node_modules/x",
11807 "name": "x",
11808 "version": "1.0.0",
11809 },
11810 "name": "y",
11811 "spec": "1",
11812 "type": "peer",
11813 },
11814 ],
11815 "isWorkspace": false,
11816 "location": "node_modules/y",
11817 "name": "y",
11818 "version": "1.0.0",
11819 },
11820 "dep": Object {
11821 "dependents": Array [
11822 Object {
11823 "error": "INVALID",
11824 "from": Object {
11825 "dependents": Array [
11826 Object {
11827 "from": Object {
11828 "dependents": Array [
11829 Object {
11830 "from": Object {
11831 "dependents": Array [
11832 Object {
11833 "from": Object {
11834 "location": "/some/path",
11835 },
11836 "name": "v",
11837 "spec": "",
11838 "type": "prod",
11839 },
11840 ],
11841 "isWorkspace": false,
11842 "location": "node_modules/v",
11843 "name": "v",
11844 "version": "1.0.0",
11845 },
11846 "name": "b",
11847 "spec": "2",
11848 "type": "prod",
11849 },
11850 ],
11851 "isWorkspace": false,
11852 "location": "node_modules/b",
11853 "name": "b",
11854 "version": "2.0.0",
11855 },
11856 "name": "k",
11857 "spec": "2",
11858 "type": "prod",
11859 },
11860 Object {
11861 "from": Object {
11862 "dependents": Array [
11863 Object {
11864 "from": Object {
11865 "dependents": Array [
11866 Object {
11867 "from": Object {
11868 "dependents": Array [
11869 Object {
11870 "from": Object {
11871 "location": "/some/path",
11872 },
11873 "name": "v",
11874 "spec": "",
11875 "type": "prod",
11876 },
11877 ],
11878 "isWorkspace": false,
11879 "location": "node_modules/v",
11880 "name": "v",
11881 "version": "1.0.0",
11882 },
11883 "name": "b",
11884 "spec": "2",
11885 "type": "prod",
11886 },
11887 ],
11888 "isWorkspace": false,
11889 "location": "node_modules/b",
11890 "name": "b",
11891 "version": "2.0.0",
11892 },
11893 "name": "c",
11894 "spec": "2",
11895 "type": "peer",
11896 },
11897 ],
11898 "isWorkspace": false,
11899 "location": "node_modules/c",
11900 "name": "c",
11901 "version": "2.0.0",
11902 },
11903 "name": "k",
11904 "spec": "2",
11905 "type": "peer",
11906 },
11907 ],
11908 "isWorkspace": false,
11909 "location": "node_modules/k",
11910 "name": "k",
11911 "version": "2.0.0",
11912 },
11913 "name": "y",
11914 "spec": "2",
11915 "type": "peer",
11916 },
11917 ],
11918 "isWorkspace": false,
11919 "location": "node_modules/y",
11920 "name": "y",
11921 "version": "1.0.0",
11922 "whileInstalling": Object {
11923 "name": "k",
11924 "path": "/some/path/node_modules/k",
11925 "version": "2.0.0",
11926 },
11927 },
11928 "edge": Object {
11929 "error": "INVALID",
11930 "from": Object {
11931 "dependents": Array [
11932 Object {
11933 "from": Object {
11934 "dependents": Array [
11935 Object {
11936 "from": Object {
11937 "dependents": Array [
11938 Object {
11939 "from": Object {
11940 "location": "/some/path",
11941 },
11942 "name": "v",
11943 "spec": "",
11944 "type": "prod",
11945 },
11946 ],
11947 "isWorkspace": false,
11948 "location": "node_modules/v",
11949 "name": "v",
11950 "version": "1.0.0",
11951 },
11952 "name": "b",
11953 "spec": "2",
11954 "type": "prod",
11955 },
11956 ],
11957 "isWorkspace": false,
11958 "location": "node_modules/b",
11959 "name": "b",
11960 "version": "2.0.0",
11961 },
11962 "name": "k",
11963 "spec": "2",
11964 "type": "prod",
11965 },
11966 Object {
11967 "from": Object {
11968 "dependents": Array [
11969 Object {
11970 "from": Object {
11971 "dependents": Array [
11972 Object {
11973 "from": Object {
11974 "dependents": Array [
11975 Object {
11976 "from": Object {
11977 "location": "/some/path",
11978 },
11979 "name": "v",
11980 "spec": "",
11981 "type": "prod",
11982 },
11983 ],
11984 "isWorkspace": false,
11985 "location": "node_modules/v",
11986 "name": "v",
11987 "version": "1.0.0",
11988 },
11989 "name": "b",
11990 "spec": "2",
11991 "type": "prod",
11992 },
11993 ],
11994 "isWorkspace": false,
11995 "location": "node_modules/b",
11996 "name": "b",
11997 "version": "2.0.0",
11998 },
11999 "name": "c",
12000 "spec": "2",
12001 "type": "peer",
12002 },
12003 ],
12004 "isWorkspace": false,
12005 "location": "node_modules/c",
12006 "name": "c",
12007 "version": "2.0.0",
12008 },
12009 "name": "k",
12010 "spec": "2",
12011 "type": "peer",
12012 },
12013 ],
12014 "isWorkspace": false,
12015 "location": "node_modules/k",
12016 "name": "k",
12017 "version": "2.0.0",
12018 },
12019 "name": "y",
12020 "spec": "2",
12021 "type": "peer",
12022 },
12023 "force": false,
12024 "isMine": false,
12025 "strictPeerDeps": false,
12026 },
12027 ],
12028 ]
12029 `
12030
12031 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on less deep peer dep, step 2, override, no current > changes to tree 1`] = `
12032 --- expected
12033 +++ actual
12034 @@ -62,8 +62,7 @@
12035 "type": "peer",
12036 "name": "y",
12037 "spec": "*",
12038 - "to": null,
12039 - "error": "MISSING",
12040 + "to": "node_modules/y",
12041 },
12042 },
12043 "edgesIn": Set {
12044 @@ -89,9 +88,9 @@
12045 "type": "peer",
12046 "name": "y",
12047 "spec": "2",
12048 - "error": "MISSING",
12049 + "error": "INVALID",
12050 "peerConflicted": true,
12051 - "to": null,
12052 + "to": "node_modules/y",
12053 },
12054 },
12055 "edgesIn": Set {
12056 @@ -129,8 +128,7 @@
12057 "type": "peer",
12058 "name": "y",
12059 "spec": "*",
12060 - "to": null,
12061 - "error": "MISSING",
12062 + "to": "node_modules/y",
12063 },
12064 },
12065 "edgesIn": Set {
12066 @@ -156,8 +154,7 @@
12067 "type": "peer",
12068 "name": "y",
12069 "spec": "1",
12070 - "to": null,
12071 - "error": "MISSING",
12072 + "to": "node_modules/y",
12073 },
12074 },
12075 "edgesIn": Set {
12076 @@ -169,5 +166,43 @@
12077 },
12078 },
12079 },
12080 + "y" => ArboristNode {
12081 + "name": "y",
12082 + "version": "1.0.0",
12083 + "location": "node_modules/y",
12084 + "path": "/some/path/node_modules/y",
12085 + "extraneous": true,
12086 + "dev": true,
12087 + "optional": true,
12088 + "peer": true,
12089 + "edgesIn": Set {
12090 + EdgeIn {
12091 + "type": "peer",
12092 + "name": "y",
12093 + "spec": "*",
12094 + "from": "node_modules/b",
12095 + },
12096 + EdgeIn {
12097 + "type": "peer",
12098 + "name": "y",
12099 + "spec": "2",
12100 + "error": "INVALID",
12101 + "peerConflicted": true,
12102 + "from": "node_modules/k",
12103 + },
12104 + EdgeIn {
12105 + "type": "peer",
12106 + "name": "y",
12107 + "spec": "*",
12108 + "from": "node_modules/v",
12109 + },
12110 + EdgeIn {
12111 + "type": "peer",
12112 + "name": "y",
12113 + "spec": "1",
12114 + "from": "node_modules/x",
12115 + },
12116 + },
12117 + },
12118 },
12119 }
12120
12121 `
12122
12123 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on less deep peer dep, step 2, override, no current > placements 1`] = `
12124 Array [
12125 Object {
12126 "canPlace": Symbol(OK),
12127 "canPlaceSelf": Symbol(OK),
12128 "checks": Map {
12129 "" => Array [
12130 Symbol(OK),
12131 Symbol(OK),
12132 ],
12133 },
12134 "dep": "[email protected]",
12135 "edge": "{ node_modules/k peer y@2 }",
12136 "placed": "node_modules/y",
12137 },
12138 ]
12139 `
12140
12141 exports[`test/place-dep.js TAP placement tests warn ERESOLVE on less deep peer dep, step 2, override, no current > warnings 1`] = `
12142 Array [
12143 Array [
12144 "ERESOLVE",
12145 "overriding peer dependency",
12146 Object {
12147 "code": "ERESOLVE",
12148 "current": Object {
12149 "dependents": Array [
12150 Object {
12151 "from": Object {
12152 "dependents": Array [
12153 Object {
12154 "from": Object {
12155 "location": "/some/path",
12156 },
12157 "name": "v",
12158 "spec": "",
12159 "type": "prod",
12160 },
12161 ],
12162 "isWorkspace": false,
12163 "location": "node_modules/v",
12164 "name": "v",
12165 "version": "1.0.0",
12166 },
12167 "name": "y",
12168 "spec": "",
12169 "type": "peer",
12170 },
12171 Object {
12172 "from": Object {
12173 "dependents": Array [
12174 Object {
12175 "from": Object {
12176 "dependents": Array [
12177 Object {
12178 "from": Object {
12179 "dependents": Array [
12180 Object {
12181 "from": Object {
12182 "location": "/some/path",
12183 },
12184 "name": "v",
12185 "spec": "",
12186 "type": "prod",
12187 },
12188 ],
12189 "isWorkspace": false,
12190 "location": "node_modules/v",
12191 "name": "v",
12192 "version": "1.0.0",
12193 },
12194 "name": "a",
12195 "spec": "1",
12196 "type": "prod",
12197 },
12198 ],
12199 "isWorkspace": false,
12200 "location": "node_modules/a",
12201 "name": "a",
12202 "version": "1.0.0",
12203 },
12204 "name": "x",
12205 "spec": "1",
12206 "type": "peer",
12207 },
12208 ],
12209 "isWorkspace": false,
12210 "location": "node_modules/x",
12211 "name": "x",
12212 "version": "1.0.0",
12213 },
12214 "name": "y",
12215 "spec": "1",
12216 "type": "peer",
12217 },
12218 Object {
12219 "from": Object {
12220 "dependents": Array [
12221 Object {
12222 "from": Object {
12223 "dependents": Array [
12224 Object {
12225 "from": Object {
12226 "location": "/some/path",
12227 },
12228 "name": "v",
12229 "spec": "",
12230 "type": "prod",
12231 },
12232 ],
12233 "isWorkspace": false,
12234 "location": "node_modules/v",
12235 "name": "v",
12236 "version": "1.0.0",
12237 },
12238 "name": "b",
12239 "spec": "2",
12240 "type": "prod",
12241 },
12242 ],
12243 "isWorkspace": false,
12244 "location": "node_modules/b",
12245 "name": "b",
12246 "version": "2.0.0",
12247 },
12248 "name": "y",
12249 "spec": "",
12250 "type": "peer",
12251 },
12252 ],
12253 "isWorkspace": false,
12254 "location": "node_modules/y",
12255 "name": "y",
12256 "version": "1.0.0",
12257 },
12258 "dep": Object {
12259 "dependents": Array [
12260 Object {
12261 "error": "INVALID",
12262 "from": Object {
12263 "dependents": Array [
12264 Object {
12265 "from": Object {
12266 "dependents": Array [
12267 Object {
12268 "from": Object {
12269 "dependents": Array [
12270 Object {
12271 "from": Object {
12272 "location": "/some/path",
12273 },
12274 "name": "v",
12275 "spec": "",
12276 "type": "prod",
12277 },
12278 ],
12279 "isWorkspace": false,
12280 "location": "node_modules/v",
12281 "name": "v",
12282 "version": "1.0.0",
12283 },
12284 "name": "b",
12285 "spec": "2",
12286 "type": "prod",
12287 },
12288 ],
12289 "isWorkspace": false,
12290 "location": "node_modules/b",
12291 "name": "b",
12292 "version": "2.0.0",
12293 },
12294 "name": "k",
12295 "spec": "2",
12296 "type": "prod",
12297 },
12298 ],
12299 "isWorkspace": false,
12300 "location": "node_modules/k",
12301 "name": "k",
12302 "version": "2.0.0",
12303 },
12304 "name": "y",
12305 "spec": "2",
12306 "type": "peer",
12307 },
12308 ],
12309 "isWorkspace": false,
12310 "location": "node_modules/y",
12311 "name": "y",
12312 "version": "1.0.0",
12313 "whileInstalling": Object {
12314 "name": "k",
12315 "path": "/some/path/node_modules/k",
12316 "version": "2.0.0",
12317 },
12318 },
12319 "edge": Object {
12320 "error": "INVALID",
12321 "from": Object {
12322 "dependents": Array [
12323 Object {
12324 "from": Object {
12325 "dependents": Array [
12326 Object {
12327 "from": Object {
12328 "dependents": Array [
12329 Object {
12330 "from": Object {
12331 "location": "/some/path",
12332 },
12333 "name": "v",
12334 "spec": "",
12335 "type": "prod",
12336 },
12337 ],
12338 "isWorkspace": false,
12339 "location": "node_modules/v",
12340 "name": "v",
12341 "version": "1.0.0",
12342 },
12343 "name": "b",
12344 "spec": "2",
12345 "type": "prod",
12346 },
12347 ],
12348 "isWorkspace": false,
12349 "location": "node_modules/b",
12350 "name": "b",
12351 "version": "2.0.0",
12352 },
12353 "name": "k",
12354 "spec": "2",
12355 "type": "prod",
12356 },
12357 ],
12358 "isWorkspace": false,
12359 "location": "node_modules/k",
12360 "name": "k",
12361 "version": "2.0.0",
12362 },
12363 "name": "y",
12364 "spec": "2",
12365 "type": "peer",
12366 },
12367 "force": false,
12368 "isMine": false,
12369 "strictPeerDeps": false,
12370 },
12371 ],
12372 ]
12373 `