Debian Codegraph @

workspaces/arborist/tap-snapshots/test/diff.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/diff.js TAP > diff two trees 1`] = `
9 Diff {
10 "action": null,
11 "actual": Node {
12 "name": "a",
13 "path": "/path/to/root",
14 "integrity": "sha512-aaa",
15 },
16 "ideal": Node {
17 "name": "a",
18 "path": "/path/to/root",
19 "integrity": "sha512-aaa",
20 },
21 "leaves": Array [
22 "/path/to/root/node_modules/b/node_modules/c",
23 "/path/to/root/node_modules/b/node_modules/d/node_modules/e",
24 "/path/to/root/node_modules/x/node_modules/y",
25 "/path/to/root/node_modules/p/node_modules/q",
26 "/path/to/root/node_modules/bundler/node_modules/not-bundled",
27 "/path/to/root/node_modules/should-have-bins",
28 "/path/to/root/foo/node_modules/baz",
29 "/path/to/root/node_modules/i/node_modules/j",
30 "/path/to/root/foo/node_modules/boo",
31 ],
32 "unchanged": Array [
33 "/path/to/root/node_modules/x",
34 "/path/to/root/node_modules/bundler",
35 "/path/to/root/node_modules/bundler/node_modules/bundled-a",
36 "/path/to/root/node_modules/bundler/node_modules/metabundled",
37 "/path/to/root/foo/node_modules/bar",
38 "/path/to/root/node_modules/b/node_modules/d",
39 "/path/to/root/node_modules/b/node_modules/f",
40 "/path/to/root/node_modules/x/node_modules/y/node_modules/z",
41 ],
42 "removed": Array [
43 "/path/to/root/node_modules/p",
44 "/path/to/root/node_modules/p/node_modules/q",
45 ],
46 "children": Array [
47 Diff {
48 "action": "CHANGE",
49 "actual": Node {
50 "name": "baz",
51 "path": "/path/to/root/foo/node_modules/baz",
52 "integrity": "sha512-baz",
53 },
54 "ideal": Node {
55 "name": "baz",
56 "path": "/path/to/root/foo/node_modules/baz",
57 "integrity": "sha512-BAZ",
58 },
59 "leaves": Array [
60 "/path/to/root/foo/node_modules/baz",
61 ],
62 "unchanged": Array [],
63 "removed": Array [],
64 "children": Array [],
65 },
66 Diff {
67 "action": "ADD",
68 "actual": undefined,
69 "ideal": Node {
70 "name": "boo",
71 "path": "/path/to/root/foo/node_modules/boo",
72 "integrity": "sha512-BOO",
73 },
74 "leaves": Array [
75 "/path/to/root/foo/node_modules/boo",
76 ],
77 "unchanged": Array [],
78 "removed": Array [],
79 "children": Array [],
80 },
81 Diff {
82 "action": "CHANGE",
83 "actual": Node {
84 "name": "b",
85 "path": "/path/to/root/node_modules/b",
86 "integrity": "sha512-bbb",
87 },
88 "ideal": Node {
89 "name": "b",
90 "path": "/path/to/root/node_modules/b",
91 "integrity": "sha512-BBB",
92 },
93 "leaves": Array [
94 "/path/to/root/node_modules/b/node_modules/c",
95 "/path/to/root/node_modules/b/node_modules/d/node_modules/e",
96 ],
97 "unchanged": Array [
98 "/path/to/root/node_modules/b/node_modules/d",
99 "/path/to/root/node_modules/b/node_modules/f",
100 ],
101 "removed": Array [],
102 "children": Array [
103 Diff {
104 "action": "CHANGE",
105 "actual": Node {
106 "name": "c",
107 "path": "/path/to/root/node_modules/b/node_modules/c",
108 "integrity": "sha512-ccc",
109 },
110 "ideal": Node {
111 "name": "c",
112 "path": "/path/to/root/node_modules/b/node_modules/c",
113 "integrity": "sha512-CCC",
114 },
115 "leaves": Array [
116 "/path/to/root/node_modules/b/node_modules/c",
117 ],
118 "unchanged": Array [],
119 "removed": Array [],
120 "children": Array [],
121 },
122 Diff {
123 "action": "CHANGE",
124 "actual": Node {
125 "name": "e",
126 "path": "/path/to/root/node_modules/b/node_modules/d/node_modules/e",
127 "integrity": "sha512-eee",
128 },
129 "ideal": Node {
130 "name": "e",
131 "path": "/path/to/root/node_modules/b/node_modules/d/node_modules/e",
132 "integrity": "sha512-EEE",
133 },
134 "leaves": Array [
135 "/path/to/root/node_modules/b/node_modules/d/node_modules/e",
136 ],
137 "unchanged": Array [],
138 "removed": Array [],
139 "children": Array [],
140 },
141 ],
142 },
143 Diff {
144 "action": "CHANGE",
145 "actual": Node {
146 "name": "not-bundled",
147 "path": "/path/to/root/node_modules/bundler/node_modules/not-bundled",
148 "integrity": "sha512-not-bundled",
149 },
150 "ideal": Node {
151 "name": "not-bundled",
152 "path": "/path/to/root/node_modules/bundler/node_modules/not-bundled",
153 "integrity": "sha512-NOT-BUNDLED",
154 },
155 "leaves": Array [
156 "/path/to/root/node_modules/bundler/node_modules/not-bundled",
157 ],
158 "unchanged": Array [],
159 "removed": Array [],
160 "children": Array [],
161 },
162 Diff {
163 "action": "ADD",
164 "actual": undefined,
165 "ideal": Node {
166 "name": "i",
167 "path": "/path/to/root/node_modules/i",
168 "integrity": "sha512-III",
169 },
170 "leaves": Array [
171 "/path/to/root/node_modules/i/node_modules/j",
172 ],
173 "unchanged": Array [],
174 "removed": Array [],
175 "children": Array [
176 Diff {
177 "action": "ADD",
178 "actual": undefined,
179 "ideal": Node {
180 "name": "j",
181 "path": "/path/to/root/node_modules/i/node_modules/j",
182 "integrity": "sha512-JJJ",
183 },
184 "leaves": Array [
185 "/path/to/root/node_modules/i/node_modules/j",
186 ],
187 "unchanged": Array [],
188 "removed": Array [],
189 "children": Array [],
190 },
191 ],
192 },
193 Diff {
194 "action": "REMOVE",
195 "actual": Node {
196 "name": "p",
197 "path": "/path/to/root/node_modules/p",
198 "integrity": "sha512-ppp",
199 },
200 "ideal": undefined,
201 "leaves": Array [
202 "/path/to/root/node_modules/p/node_modules/q",
203 ],
204 "unchanged": Array [],
205 "removed": Array [
206 "/path/to/root/node_modules/p/node_modules/q",
207 ],
208 "children": Array [
209 Diff {
210 "action": "REMOVE",
211 "actual": Node {
212 "name": "q",
213 "path": "/path/to/root/node_modules/p/node_modules/q",
214 "integrity": "sha512-qqq",
215 },
216 "ideal": undefined,
217 "leaves": Array [
218 "/path/to/root/node_modules/p/node_modules/q",
219 ],
220 "unchanged": Array [],
221 "removed": Array [],
222 "children": Array [],
223 },
224 ],
225 },
226 Diff {
227 "action": "CHANGE",
228 "actual": Node {
229 "name": "should-have-bins",
230 "path": "/path/to/root/node_modules/should-have-bins",
231 "integrity": "sha512-should-have-bins",
232 },
233 "ideal": Node {
234 "name": "should-have-bins",
235 "path": "/path/to/root/node_modules/should-have-bins",
236 "integrity": "sha512-should-have-bins",
237 },
238 "leaves": Array [
239 "/path/to/root/node_modules/should-have-bins",
240 ],
241 "unchanged": Array [],
242 "removed": Array [],
243 "children": Array [],
244 },
245 Diff {
246 "action": "CHANGE",
247 "actual": Node {
248 "name": "y",
249 "path": "/path/to/root/node_modules/x/node_modules/y",
250 "integrity": "sha512-yyy",
251 },
252 "ideal": Node {
253 "name": "y",
254 "path": "/path/to/root/node_modules/x/node_modules/y",
255 "integrity": "sha512-YYY",
256 },
257 "leaves": Array [
258 "/path/to/root/node_modules/x/node_modules/y",
259 ],
260 "unchanged": Array [
261 "/path/to/root/node_modules/x/node_modules/y/node_modules/z",
262 ],
263 "removed": Array [],
264 "children": Array [],
265 },
266 ],
267 }
268 `
269
270 exports[`test/diff.js TAP diff doesnt break unchanged shrinkwrapped deps > made no changes 1`] = `
271 Diff {
272 "action": null,
273 "actual": Node {
274 "name": "a",
275 "path": "/path/to/actual",
276 "integrity": null,
277 },
278 "ideal": Node {
279 "name": "a",
280 "path": "/path/to/actual",
281 "integrity": null,
282 },
283 "leaves": Array [
284 "/path/to/actual/node_modules/shrinkwrapped-dep",
285 ],
286 "unchanged": Array [
287 "/path/to/actual/node_modules/regular-dep",
288 "/path/to/actual/node_modules/regular-dep/node_modules/shrinkwrapped-inner",
289 "/path/to/actual/node_modules/regular-dep/node_modules/shrinkwrapped-inner/node_modules/shrinkwrap-inner-c",
290 ],
291 "removed": Array [],
292 "children": Array [
293 Diff {
294 "action": null,
295 "actual": Node {
296 "name": "shrinkwrapped-dep",
297 "path": "/path/to/actual/node_modules/shrinkwrapped-dep",
298 "integrity": "sha512-ddd",
299 },
300 "ideal": Node {
301 "name": "shrinkwrapped-dep",
302 "path": "/path/to/actual/node_modules/shrinkwrapped-dep",
303 "integrity": "sha512-ddd",
304 },
305 "leaves": Array [
306 "/path/to/actual/node_modules/shrinkwrapped-dep",
307 ],
308 "unchanged": Array [],
309 "removed": Array [],
310 "children": Array [],
311 },
312 ],
313 }
314 `
315
316 exports[`test/diff.js TAP extraneous pruning in workspaces > prune in workspace A 1`] = `
317 Diff {
318 "action": null,
319 "actual": Node {
320 "name": "tap-testdir-diff-extraneous-pruning-in-workspaces",
321 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces",
322 "integrity": null,
323 },
324 "ideal": Node {
325 "name": "tap-testdir-diff-extraneous-pruning-in-workspaces",
326 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces",
327 "integrity": null,
328 },
329 "leaves": Array [
330 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/a/node_modules/once",
331 ],
332 "unchanged": Array [],
333 "removed": Array [
334 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/a/node_modules/once",
335 ],
336 "children": Array [
337 Diff {
338 "action": "REMOVE",
339 "actual": Node {
340 "name": "once",
341 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/a/node_modules/once",
342 "integrity": null,
343 },
344 "ideal": undefined,
345 "leaves": Array [
346 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/a/node_modules/once",
347 ],
348 "unchanged": Array [],
349 "removed": Array [],
350 "children": Array [],
351 },
352 ],
353 }
354 `
355
356 exports[`test/diff.js TAP extraneous pruning in workspaces > prune in workspace B 1`] = `
357 Diff {
358 "action": null,
359 "actual": Node {
360 "name": "tap-testdir-diff-extraneous-pruning-in-workspaces",
361 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces",
362 "integrity": null,
363 },
364 "ideal": Node {
365 "name": "tap-testdir-diff-extraneous-pruning-in-workspaces",
366 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces",
367 "integrity": null,
368 },
369 "leaves": Array [
370 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/abbrev",
371 ],
372 "unchanged": Array [
373 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/once",
374 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/wrappy",
375 ],
376 "removed": Array [
377 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/abbrev",
378 ],
379 "children": Array [
380 Diff {
381 "action": "REMOVE",
382 "actual": Node {
383 "name": "abbrev",
384 "path": "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/abbrev",
385 "integrity": null,
386 },
387 "ideal": undefined,
388 "leaves": Array [
389 "{CWD}/test/tap-testdir-diff-extraneous-pruning-in-workspaces/packages/b/node_modules/abbrev",
390 ],
391 "unchanged": Array [],
392 "removed": Array [],
393 "children": Array [],
394 },
395 ],
396 }
397 `
398
399 exports[`test/diff.js TAP filtered diff > c excluded, a and b present 1`] = `
400 Diff {
401 "action": null,
402 "actual": Node {
403 "name": "path",
404 "path": "/project/path",
405 "integrity": null,
406 },
407 "ideal": Node {
408 "name": "path",
409 "path": "/project/path",
410 "integrity": null,
411 },
412 "leaves": Array [
413 "/project/path/node_modules/a",
414 "/project/path/node_modules/b",
415 ],
416 "unchanged": Array [],
417 "removed": Array [],
418 "children": Array [
419 Diff {
420 "action": "ADD",
421 "actual": undefined,
422 "ideal": Link {
423 "name": "a",
424 "path": "/project/path/node_modules/a",
425 "integrity": null,
426 },
427 "leaves": Array [
428 "/project/path/node_modules/a",
429 ],
430 "unchanged": Array [],
431 "removed": Array [],
432 "children": Array [],
433 },
434 Diff {
435 "action": "ADD",
436 "actual": undefined,
437 "ideal": Node {
438 "name": "b",
439 "path": "/project/path/node_modules/b",
440 "integrity": null,
441 },
442 "leaves": Array [
443 "/project/path/node_modules/b",
444 ],
445 "unchanged": Array [],
446 "removed": Array [],
447 "children": Array [],
448 },
449 ],
450 }
451 `
452
453 exports[`test/diff.js TAP filtered diff > d is removed 1`] = `
454 Diff {
455 "action": null,
456 "actual": Node {
457 "name": "path",
458 "path": "/project/path",
459 "integrity": null,
460 },
461 "ideal": Node {
462 "name": "path",
463 "path": "/project/path",
464 "integrity": null,
465 },
466 "leaves": Array [
467 "/project/path/node_modules/d",
468 ],
469 "unchanged": Array [
470 "/project/path/node_modules/a",
471 "/project/path/node_modules/b",
472 ],
473 "removed": Array [
474 "/project/path/node_modules/d",
475 ],
476 "children": Array [
477 Diff {
478 "action": "REMOVE",
479 "actual": Node {
480 "name": "d",
481 "path": "/project/path/node_modules/d",
482 "integrity": null,
483 },
484 "ideal": undefined,
485 "leaves": Array [
486 "/project/path/node_modules/d",
487 ],
488 "unchanged": Array [],
489 "removed": Array [],
490 "children": Array [],
491 },
492 ],
493 }
494 `
495
496 exports[`test/diff.js TAP filtered diff > e is removed (extraneous) 1`] = `
497 Diff {
498 "action": null,
499 "actual": Node {
500 "name": "path",
501 "path": "/project/path",
502 "integrity": null,
503 },
504 "ideal": Node {
505 "name": "path",
506 "path": "/project/path",
507 "integrity": null,
508 },
509 "leaves": Array [
510 "/project/path/node_modules/e",
511 ],
512 "unchanged": Array [],
513 "removed": Array [
514 "/project/path/node_modules/e",
515 ],
516 "children": Array [
517 Diff {
518 "action": "REMOVE",
519 "actual": Node {
520 "name": "e",
521 "path": "/project/path/node_modules/e",
522 "integrity": null,
523 },
524 "ideal": undefined,
525 "leaves": Array [
526 "/project/path/node_modules/e",
527 ],
528 "unchanged": Array [],
529 "removed": Array [],
530 "children": Array [],
531 },
532 ],
533 }
534 `
535
536 exports[`test/diff.js TAP filtered diff > e is removed 1`] = `
537 Diff {
538 "action": null,
539 "actual": Node {
540 "name": "path",
541 "path": "/project/path",
542 "integrity": null,
543 },
544 "ideal": Node {
545 "name": "path",
546 "path": "/project/path",
547 "integrity": null,
548 },
549 "leaves": Array [
550 "/project/path/node_modules/e",
551 ],
552 "unchanged": Array [],
553 "removed": Array [
554 "/project/path/node_modules/e",
555 ],
556 "children": Array [
557 Diff {
558 "action": "REMOVE",
559 "actual": Node {
560 "name": "e",
561 "path": "/project/path/node_modules/e",
562 "integrity": null,
563 },
564 "ideal": undefined,
565 "leaves": Array [
566 "/project/path/node_modules/e",
567 ],
568 "unchanged": Array [],
569 "removed": Array [],
570 "children": Array [],
571 },
572 ],
573 }
574 `
575
576 exports[`test/diff.js TAP when a root is a link, traverse the target children global=false > correctly removes the child node 1`] = `
577 Diff {
578 "action": null,
579 "actual": Link {
580 "name": "path",
581 "path": "/some/linked/path",
582 "integrity": null,
583 },
584 "ideal": Node {
585 "name": "path",
586 "path": "/some/real/path",
587 "integrity": null,
588 },
589 "leaves": Array [
590 "/some/real/path/node_modules/child",
591 ],
592 "unchanged": Array [],
593 "removed": Array [
594 "/some/real/path/node_modules/child",
595 ],
596 "children": Array [
597 Diff {
598 "action": "REMOVE",
599 "actual": Node {
600 "name": "child",
601 "path": "/some/real/path/node_modules/child",
602 "integrity": null,
603 },
604 "ideal": undefined,
605 "leaves": Array [
606 "/some/real/path/node_modules/child",
607 ],
608 "unchanged": Array [],
609 "removed": Array [],
610 "children": Array [],
611 },
612 ],
613 }
614 `
615
616 exports[`test/diff.js TAP when a root is a link, traverse the target children global=true > correctly removes the child node 1`] = `
617 Diff {
618 "action": null,
619 "actual": Link {
620 "name": "path",
621 "path": "/some/linked/path",
622 "integrity": null,
623 },
624 "ideal": Node {
625 "name": "path",
626 "path": "/some/real/path",
627 "integrity": null,
628 },
629 "leaves": Array [
630 "/some/real/path/node_modules/child",
631 ],
632 "unchanged": Array [],
633 "removed": Array [
634 "/some/real/path/node_modules/child",
635 ],
636 "children": Array [
637 Diff {
638 "action": "REMOVE",
639 "actual": Node {
640 "name": "child",
641 "path": "/some/real/path/node_modules/child",
642 "integrity": null,
643 },
644 "ideal": undefined,
645 "leaves": Array [
646 "/some/real/path/node_modules/child",
647 ],
648 "unchanged": Array [],
649 "removed": Array [],
650 "children": Array [],
651 },
652 ],
653 }
654 `