Debian Codegraph @

tap-snapshots/workspaces/arborist/test/calc-dep-flags.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[`workspaces/arborist/test/calc-dep-flags.js TAP flag stuff > after 1`] = `
9 ArboristNode {
10 "children": Map {
11 "dev" => ArboristNode {
12 "dev": true,
13 "edgesIn": Set {
14 EdgeIn {
15 "from": "",
16 "name": "dev",
17 "spec": "*",
18 "type": "dev",
19 },
20 },
21 "edgesOut": Map {
22 "devdep" => EdgeOut {
23 "name": "devdep",
24 "spec": "*",
25 "to": "node_modules/devdep",
26 "type": "prod",
27 },
28 },
29 "location": "node_modules/dev",
30 "name": "dev",
31 "path": "/x/node_modules/dev",
32 "version": "1.2.3",
33 },
34 "devandoptional" => ArboristNode {
35 "dev": true,
36 "edgesIn": Set {
37 EdgeIn {
38 "from": "node_modules/devdep",
39 "name": "devandoptional",
40 "spec": "*",
41 "type": "optional",
42 },
43 },
44 "location": "node_modules/devandoptional",
45 "name": "devandoptional",
46 "optional": true,
47 "path": "/x/node_modules/devandoptional",
48 "version": "1.2.3",
49 },
50 "devdep" => ArboristNode {
51 "children": Map {
52 "linky" => ArboristLink {
53 "dev": true,
54 "edgesIn": Set {
55 EdgeIn {
56 "from": "node_modules/devdep",
57 "name": "linky",
58 "spec": "*",
59 "type": "prod",
60 },
61 },
62 "location": "node_modules/devdep/node_modules/linky",
63 "name": "linky",
64 "path": "/x/node_modules/devdep/node_modules/linky",
65 "realpath": "/x/y/z",
66 "resolved": "file:../../../y/z",
67 "target": ArboristNode {
68 "location": "y/z",
69 },
70 "version": "1.2.3",
71 },
72 },
73 "dev": true,
74 "edgesIn": Set {
75 EdgeIn {
76 "from": "node_modules/dev",
77 "name": "devdep",
78 "spec": "*",
79 "type": "prod",
80 },
81 },
82 "edgesOut": Map {
83 "devandoptional" => EdgeOut {
84 "name": "devandoptional",
85 "spec": "*",
86 "to": "node_modules/devandoptional",
87 "type": "optional",
88 },
89 "devoptional" => EdgeOut {
90 "name": "devoptional",
91 "spec": "*",
92 "to": "node_modules/devoptional",
93 "type": "prod",
94 },
95 "linky" => EdgeOut {
96 "name": "linky",
97 "spec": "*",
98 "to": "node_modules/devdep/node_modules/linky",
99 "type": "prod",
100 },
101 "proddep" => EdgeOut {
102 "name": "proddep",
103 "spec": "*",
104 "to": "node_modules/proddep",
105 "type": "prod",
106 },
107 },
108 "location": "node_modules/devdep",
109 "name": "devdep",
110 "path": "/x/node_modules/devdep",
111 "version": "1.2.3",
112 },
113 "devoptional" => ArboristNode {
114 "devOptional": true,
115 "edgesIn": Set {
116 EdgeIn {
117 "from": "node_modules/devdep",
118 "name": "devoptional",
119 "spec": "*",
120 "type": "prod",
121 },
122 EdgeIn {
123 "from": "node_modules/optional",
124 "name": "devoptional",
125 "spec": "*",
126 "type": "prod",
127 },
128 },
129 "location": "node_modules/devoptional",
130 "name": "devoptional",
131 "path": "/x/node_modules/devoptional",
132 "version": "1.2.3",
133 },
134 "extraneous" => ArboristNode {
135 "dev": true,
136 "extraneous": true,
137 "location": "node_modules/extraneous",
138 "name": "extraneous",
139 "optional": true,
140 "path": "/x/node_modules/extraneous",
141 "peer": true,
142 },
143 "metapeer" => ArboristNode {
144 "edgesIn": Set {
145 EdgeIn {
146 "from": "node_modules/prod",
147 "name": "metapeer",
148 "spec": "*",
149 "type": "peer",
150 },
151 },
152 "edgesOut": Map {
153 "metapeerdep" => EdgeOut {
154 "name": "metapeerdep",
155 "spec": "*",
156 "to": "node_modules/metapeerdep",
157 "type": "prod",
158 },
159 },
160 "location": "node_modules/metapeer",
161 "name": "metapeer",
162 "path": "/x/node_modules/metapeer",
163 "peer": true,
164 "version": "1.2.3",
165 },
166 "metapeerdep" => ArboristNode {
167 "edgesIn": Set {
168 EdgeIn {
169 "from": "node_modules/metapeer",
170 "name": "metapeerdep",
171 "spec": "*",
172 "type": "prod",
173 },
174 },
175 "location": "node_modules/metapeerdep",
176 "name": "metapeerdep",
177 "path": "/x/node_modules/metapeerdep",
178 "version": "1.2.3",
179 },
180 "optional" => ArboristNode {
181 "edgesIn": Set {
182 EdgeIn {
183 "from": "",
184 "name": "optional",
185 "spec": "*",
186 "type": "optional",
187 },
188 },
189 "edgesOut": Map {
190 "devoptional" => EdgeOut {
191 "name": "devoptional",
192 "spec": "*",
193 "to": "node_modules/devoptional",
194 "type": "prod",
195 },
196 "missing" => EdgeOut {
197 "error": "MISSING",
198 "name": "missing",
199 "spec": "*",
200 "to": null,
201 "type": "prod",
202 },
203 },
204 "location": "node_modules/optional",
205 "name": "optional",
206 "optional": true,
207 "path": "/x/node_modules/optional",
208 "version": "1.2.3",
209 },
210 "peer" => ArboristNode {
211 "edgesIn": Set {
212 EdgeIn {
213 "from": "",
214 "name": "peer",
215 "spec": "*",
216 "type": "peer",
217 },
218 },
219 "edgesOut": Map {
220 "peerdep" => EdgeOut {
221 "name": "peerdep",
222 "spec": "*",
223 "to": "node_modules/peerdep",
224 "type": "prod",
225 },
226 },
227 "location": "node_modules/peer",
228 "name": "peer",
229 "path": "/x/node_modules/peer",
230 "peer": true,
231 "version": "1.2.3",
232 },
233 "peerdep" => ArboristNode {
234 "edgesIn": Set {
235 EdgeIn {
236 "from": "node_modules/peer",
237 "name": "peerdep",
238 "spec": "*",
239 "type": "prod",
240 },
241 },
242 "location": "node_modules/peerdep",
243 "name": "peerdep",
244 "path": "/x/node_modules/peerdep",
245 "version": "1.2.3",
246 },
247 "prod" => ArboristNode {
248 "edgesIn": Set {
249 EdgeIn {
250 "from": "",
251 "name": "prod",
252 "spec": "*",
253 "type": "prod",
254 },
255 },
256 "edgesOut": Map {
257 "metapeer" => EdgeOut {
258 "name": "metapeer",
259 "spec": "*",
260 "to": "node_modules/metapeer",
261 "type": "peer",
262 },
263 "proddep" => EdgeOut {
264 "name": "proddep",
265 "spec": "*",
266 "to": "node_modules/proddep",
267 "type": "prod",
268 },
269 },
270 "location": "node_modules/prod",
271 "name": "prod",
272 "path": "/x/node_modules/prod",
273 "version": "1.2.3",
274 },
275 "proddep" => ArboristNode {
276 "edgesIn": Set {
277 EdgeIn {
278 "from": "node_modules/devdep",
279 "name": "proddep",
280 "spec": "*",
281 "type": "prod",
282 },
283 EdgeIn {
284 "from": "node_modules/prod",
285 "name": "proddep",
286 "spec": "*",
287 "type": "prod",
288 },
289 EdgeIn {
290 "from": "node_modules/proddep",
291 "name": "proddep",
292 "spec": "*",
293 "type": "prod",
294 },
295 },
296 "edgesOut": Map {
297 "proddep" => EdgeOut {
298 "name": "proddep",
299 "spec": "*",
300 "to": "node_modules/proddep",
301 "type": "prod",
302 },
303 },
304 "location": "node_modules/proddep",
305 "name": "proddep",
306 "path": "/x/node_modules/proddep",
307 "version": "1.2.3",
308 },
309 },
310 "edgesOut": Map {
311 "dev" => EdgeOut {
312 "name": "dev",
313 "spec": "*",
314 "to": "node_modules/dev",
315 "type": "dev",
316 },
317 "optional" => EdgeOut {
318 "name": "optional",
319 "spec": "*",
320 "to": "node_modules/optional",
321 "type": "optional",
322 },
323 "peer" => EdgeOut {
324 "name": "peer",
325 "spec": "*",
326 "to": "node_modules/peer",
327 "type": "peer",
328 },
329 "prod" => EdgeOut {
330 "name": "prod",
331 "spec": "*",
332 "to": "node_modules/prod",
333 "type": "prod",
334 },
335 },
336 "fsChildren": Set {
337 ArboristNode {
338 "children": Map {
339 "linklink" => ArboristLink {
340 "dev": true,
341 "edgesIn": Set {
342 EdgeIn {
343 "from": "y/z",
344 "name": "linklink",
345 "spec": "*",
346 "type": "prod",
347 },
348 },
349 "location": "y/z/node_modules/linklink",
350 "name": "linklink",
351 "path": "/x/y/z/node_modules/linklink",
352 "realpath": "/l/i/n/k/link",
353 "resolved": "file:../../../../l/i/n/k/link",
354 "target": ArboristNode {
355 "dev": true,
356 "location": "../l/i/n/k/link",
357 "name": "link",
358 "packageName": "linklink",
359 "path": "/l/i/n/k/link",
360 "version": "1.2.3",
361 },
362 "version": "1.2.3",
363 },
364 },
365 "dev": true,
366 "edgesOut": Map {
367 "linklink" => EdgeOut {
368 "name": "linklink",
369 "spec": "*",
370 "to": "y/z/node_modules/linklink",
371 "type": "prod",
372 },
373 },
374 "location": "y/z",
375 "name": "z",
376 "packageName": "linky",
377 "path": "/x/y/z",
378 "version": "1.2.3",
379 },
380 },
381 "isProjectRoot": true,
382 "location": "",
383 "name": "x",
384 "path": "/x",
385 }
386 `
387
388 exports[`workspaces/arborist/test/calc-dep-flags.js TAP no reset > after 1`] = `
389 ArboristNode {
390 "children": Map {
391 "foo" => ArboristNode {
392 "dev": true,
393 "edgesIn": Set {
394 EdgeIn {
395 "from": "",
396 "name": "foo",
397 "spec": "*",
398 "type": "prod",
399 },
400 },
401 "location": "node_modules/foo",
402 "name": "foo",
403 "path": "/some/path/node_modules/foo",
404 "version": "1.2.3",
405 },
406 },
407 "dev": true,
408 "edgesOut": Map {
409 "foo" => EdgeOut {
410 "name": "foo",
411 "spec": "*",
412 "to": "node_modules/foo",
413 "type": "prod",
414 },
415 },
416 "isProjectRoot": true,
417 "location": "",
418 "name": "path",
419 "path": "/some/path",
420 }
421 `
422
423 exports[`workspaces/arborist/test/calc-dep-flags.js TAP peer dependency with optional dependency > after calcDepFlags 1`] = `
424 ArboristNode {
425 "children": Map {
426 "B" => ArboristNode {
427 "edgesIn": Set {
428 EdgeIn {
429 "from": "",
430 "name": "B",
431 "spec": "1.0.0",
432 "type": "prod",
433 },
434 },
435 "edgesOut": Map {
436 "C" => EdgeOut {
437 "name": "C",
438 "spec": "1.0.0",
439 "to": "node_modules/C",
440 "type": "peer",
441 },
442 },
443 "location": "node_modules/B",
444 "name": "B",
445 "path": "/project/node_modules/B",
446 "version": "1.0.0",
447 },
448 "C" => ArboristNode {
449 "edgesIn": Set {
450 EdgeIn {
451 "from": "node_modules/B",
452 "name": "C",
453 "spec": "1.0.0",
454 "type": "peer",
455 },
456 },
457 "edgesOut": Map {
458 "D" => EdgeOut {
459 "name": "D",
460 "spec": "1.0.0",
461 "to": "node_modules/D",
462 "type": "optional",
463 },
464 },
465 "location": "node_modules/C",
466 "name": "C",
467 "path": "/project/node_modules/C",
468 "peer": true,
469 "version": "1.0.0",
470 },
471 "D" => ArboristNode {
472 "edgesIn": Set {
473 EdgeIn {
474 "from": "node_modules/C",
475 "name": "D",
476 "spec": "1.0.0",
477 "type": "optional",
478 },
479 },
480 "location": "node_modules/D",
481 "name": "D",
482 "optional": true,
483 "path": "/project/node_modules/D",
484 "version": "1.0.0",
485 },
486 },
487 "edgesOut": Map {
488 "B" => EdgeOut {
489 "name": "B",
490 "spec": "1.0.0",
491 "to": "node_modules/B",
492 "type": "prod",
493 },
494 },
495 "isProjectRoot": true,
496 "location": "",
497 "name": "project",
498 "packageName": "A",
499 "path": "/project",
500 "version": "1.0.0",
501 }
502 `
503
504 exports[`workspaces/arborist/test/calc-dep-flags.js TAP peer dependency with optional dependency > before calcDepFlags 1`] = `
505 ArboristNode {
506 "children": Map {
507 "B" => ArboristNode {
508 "dev": true,
509 "edgesIn": Set {
510 EdgeIn {
511 "from": "",
512 "name": "B",
513 "spec": "1.0.0",
514 "type": "prod",
515 },
516 },
517 "edgesOut": Map {
518 "C" => EdgeOut {
519 "name": "C",
520 "spec": "1.0.0",
521 "to": "node_modules/C",
522 "type": "peer",
523 },
524 },
525 "extraneous": true,
526 "location": "node_modules/B",
527 "name": "B",
528 "optional": true,
529 "path": "/project/node_modules/B",
530 "peer": true,
531 "version": "1.0.0",
532 },
533 "C" => ArboristNode {
534 "dev": true,
535 "edgesIn": Set {
536 EdgeIn {
537 "from": "node_modules/B",
538 "name": "C",
539 "spec": "1.0.0",
540 "type": "peer",
541 },
542 },
543 "edgesOut": Map {
544 "D" => EdgeOut {
545 "name": "D",
546 "spec": "1.0.0",
547 "to": "node_modules/D",
548 "type": "optional",
549 },
550 },
551 "extraneous": true,
552 "location": "node_modules/C",
553 "name": "C",
554 "optional": true,
555 "path": "/project/node_modules/C",
556 "peer": true,
557 "version": "1.0.0",
558 },
559 "D" => ArboristNode {
560 "dev": true,
561 "edgesIn": Set {
562 EdgeIn {
563 "from": "node_modules/C",
564 "name": "D",
565 "spec": "1.0.0",
566 "type": "optional",
567 },
568 },
569 "extraneous": true,
570 "location": "node_modules/D",
571 "name": "D",
572 "optional": true,
573 "path": "/project/node_modules/D",
574 "peer": true,
575 "version": "1.0.0",
576 },
577 },
578 "dev": true,
579 "edgesOut": Map {
580 "B" => EdgeOut {
581 "name": "B",
582 "spec": "1.0.0",
583 "to": "node_modules/B",
584 "type": "prod",
585 },
586 },
587 "extraneous": true,
588 "isProjectRoot": true,
589 "location": "",
590 "name": "project",
591 "optional": true,
592 "packageName": "A",
593 "path": "/project",
594 "peer": true,
595 "version": "1.0.0",
596 }
597 `
598
599 exports[`workspaces/arborist/test/calc-dep-flags.js TAP set parents to not extraneous when visiting > after 1`] = `
600 ArboristNode {
601 "children": Map {
602 "asdf" => ArboristNode {
603 "children": Map {
604 "baz" => ArboristNode {
605 "location": "node_modules/asdf/node_modules/baz",
606 "name": "baz",
607 "path": "/some/path/node_modules/asdf/node_modules/baz",
608 "version": "1.2.3",
609 },
610 },
611 "location": "node_modules/asdf",
612 "name": "asdf",
613 "path": "/some/path/node_modules/asdf",
614 "version": "1.2.3",
615 },
616 "baz" => ArboristLink {
617 "edgesIn": Set {
618 EdgeIn {
619 "from": "",
620 "name": "baz",
621 "spec": "file:node_modules/asdf/node_modules/baz",
622 "type": "prod",
623 },
624 },
625 "location": "node_modules/baz",
626 "name": "baz",
627 "path": "/some/path/node_modules/baz",
628 "realpath": "/some/path/node_modules/asdf/node_modules/baz",
629 "resolved": "file:asdf/node_modules/baz",
630 "target": ArboristNode {
631 "location": "node_modules/asdf/node_modules/baz",
632 },
633 "version": "1.2.3",
634 },
635 "foo" => ArboristLink {
636 "edgesIn": Set {
637 EdgeIn {
638 "from": "",
639 "name": "foo",
640 "spec": "file:bar/foo",
641 "type": "prod",
642 },
643 },
644 "location": "node_modules/foo",
645 "name": "foo",
646 "path": "/some/path/node_modules/foo",
647 "realpath": "/some/path/bar/foo",
648 "resolved": "file:../bar/foo",
649 "target": ArboristNode {
650 "location": "bar/foo",
651 },
652 "version": "1.2.3",
653 },
654 },
655 "edgesOut": Map {
656 "baz" => EdgeOut {
657 "name": "baz",
658 "spec": "file:node_modules/asdf/node_modules/baz",
659 "to": "node_modules/baz",
660 "type": "prod",
661 },
662 "foo" => EdgeOut {
663 "name": "foo",
664 "spec": "file:bar/foo",
665 "to": "node_modules/foo",
666 "type": "prod",
667 },
668 },
669 "fsChildren": Set {
670 ArboristNode {
671 "fsChildren": Set {
672 ArboristNode {
673 "location": "bar/foo",
674 "name": "foo",
675 "path": "/some/path/bar/foo",
676 "version": "1.2.3",
677 },
678 },
679 "location": "bar",
680 "name": "bar",
681 "path": "/some/path/bar",
682 },
683 },
684 "isProjectRoot": true,
685 "location": "",
686 "name": "path",
687 "path": "/some/path",
688 }
689 `
690
691 exports[`workspaces/arborist/test/calc-dep-flags.js TAP set parents to not extraneous when visiting > before 1`] = `
692 ArboristNode {
693 "children": Map {
694 "asdf" => ArboristNode {
695 "children": Map {
696 "baz" => ArboristNode {
697 "dev": true,
698 "extraneous": true,
699 "location": "node_modules/asdf/node_modules/baz",
700 "name": "baz",
701 "optional": true,
702 "path": "/some/path/node_modules/asdf/node_modules/baz",
703 "peer": true,
704 "version": "1.2.3",
705 },
706 },
707 "dev": true,
708 "extraneous": true,
709 "location": "node_modules/asdf",
710 "name": "asdf",
711 "optional": true,
712 "path": "/some/path/node_modules/asdf",
713 "peer": true,
714 "version": "1.2.3",
715 },
716 "baz" => ArboristLink {
717 "dev": true,
718 "edgesIn": Set {
719 EdgeIn {
720 "from": "",
721 "name": "baz",
722 "spec": "file:node_modules/asdf/node_modules/baz",
723 "type": "prod",
724 },
725 },
726 "extraneous": true,
727 "location": "node_modules/baz",
728 "name": "baz",
729 "optional": true,
730 "path": "/some/path/node_modules/baz",
731 "peer": true,
732 "realpath": "/some/path/node_modules/asdf/node_modules/baz",
733 "resolved": "file:asdf/node_modules/baz",
734 "target": ArboristNode {
735 "location": "node_modules/asdf/node_modules/baz",
736 },
737 "version": "1.2.3",
738 },
739 "foo" => ArboristLink {
740 "dev": true,
741 "edgesIn": Set {
742 EdgeIn {
743 "from": "",
744 "name": "foo",
745 "spec": "file:bar/foo",
746 "type": "prod",
747 },
748 },
749 "extraneous": true,
750 "location": "node_modules/foo",
751 "name": "foo",
752 "optional": true,
753 "path": "/some/path/node_modules/foo",
754 "peer": true,
755 "realpath": "/some/path/bar/foo",
756 "resolved": "file:../bar/foo",
757 "target": ArboristNode {
758 "location": "bar/foo",
759 },
760 "version": "1.2.3",
761 },
762 },
763 "dev": true,
764 "edgesOut": Map {
765 "baz" => EdgeOut {
766 "name": "baz",
767 "spec": "file:node_modules/asdf/node_modules/baz",
768 "to": "node_modules/baz",
769 "type": "prod",
770 },
771 "foo" => EdgeOut {
772 "name": "foo",
773 "spec": "file:bar/foo",
774 "to": "node_modules/foo",
775 "type": "prod",
776 },
777 },
778 "extraneous": true,
779 "fsChildren": Set {
780 ArboristNode {
781 "dev": true,
782 "extraneous": true,
783 "fsChildren": Set {
784 ArboristNode {
785 "dev": true,
786 "extraneous": true,
787 "location": "bar/foo",
788 "name": "foo",
789 "optional": true,
790 "path": "/some/path/bar/foo",
791 "peer": true,
792 "version": "1.2.3",
793 },
794 },
795 "location": "bar",
796 "name": "bar",
797 "optional": true,
798 "path": "/some/path/bar",
799 "peer": true,
800 },
801 },
802 "isProjectRoot": true,
803 "location": "",
804 "name": "path",
805 "optional": true,
806 "path": "/some/path",
807 "peer": true,
808 }
809 `