Debian Codegraph @

tap-snapshots/test/lib/utils/sbom-cyclonedx.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/lib/utils/sbom-cyclonedx.js TAP node - with deps > must match snapshot 1`] = `
9 {
10 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
11 "bomFormat": "CycloneDX",
12 "specVersion": "1.5",
13 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
14 "version": 1,
15 "metadata": {
16 "timestamp": "2020-01-01T00:00:00.000Z",
17 "lifecycles": [
18 {
19 "phase": "build"
20 }
21 ],
22 "tools": [
23 {
24 "vendor": "npm",
25 "name": "cli",
26 "version": "10.0.0 "
27 }
28 ],
29 "component": {
30 "bom-ref": "[email protected]",
31 "type": "library",
32 "name": "root",
33 "version": "1.0.0",
34 "scope": "required",
35 "author": "Author",
36 "purl": "pkg:npm/[email protected]",
37 "properties": [],
38 "externalReferences": []
39 }
40 },
41 "components": [
42 {
43 "bom-ref": "[email protected]",
44 "type": "library",
45 "name": "dep1",
46 "version": "0.0.1",
47 "scope": "required",
48 "purl": "pkg:npm/[email protected]",
49 "properties": [],
50 "externalReferences": []
51 },
52 {
53 "bom-ref": "[email protected]",
54 "type": "library",
55 "name": "dep2",
56 "version": "0.0.2",
57 "scope": "required",
58 "purl": "pkg:npm/[email protected]",
59 "properties": [],
60 "externalReferences": []
61 }
62 ],
63 "dependencies": [
64 {
65 "ref": "[email protected]",
66 "dependsOn": [
67 "[email protected]",
68 "[email protected]"
69 ]
70 },
71 {
72 "ref": "[email protected]",
73 "dependsOn": []
74 },
75 {
76 "ref": "[email protected]",
77 "dependsOn": [
78 "[email protected]"
79 ]
80 }
81 ]
82 }
83 `
84
85 exports[`test/lib/utils/sbom-cyclonedx.js TAP node - with duplicate deps > must match snapshot 1`] = `
86 {
87 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
88 "bomFormat": "CycloneDX",
89 "specVersion": "1.5",
90 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
91 "version": 1,
92 "metadata": {
93 "timestamp": "2020-01-01T00:00:00.000Z",
94 "lifecycles": [
95 {
96 "phase": "build"
97 }
98 ],
99 "tools": [
100 {
101 "vendor": "npm",
102 "name": "cli",
103 "version": "10.0.0 "
104 }
105 ],
106 "component": {
107 "bom-ref": "[email protected]",
108 "type": "library",
109 "name": "root",
110 "version": "1.0.0",
111 "scope": "required",
112 "author": "Author",
113 "purl": "pkg:npm/[email protected]",
114 "properties": [],
115 "externalReferences": []
116 }
117 },
118 "components": [
119 {
120 "bom-ref": "[email protected]",
121 "type": "library",
122 "name": "dep1",
123 "version": "0.0.1",
124 "scope": "required",
125 "purl": "pkg:npm/[email protected]",
126 "properties": [],
127 "externalReferences": []
128 }
129 ],
130 "dependencies": [
131 {
132 "ref": "[email protected]",
133 "dependsOn": [
134 "[email protected]"
135 ]
136 },
137 {
138 "ref": "[email protected]",
139 "dependsOn": []
140 }
141 ]
142 }
143 `
144
145 exports[`test/lib/utils/sbom-cyclonedx.js TAP node - with duplicate edges to same dep > must match snapshot 1`] = `
146 {
147 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
148 "bomFormat": "CycloneDX",
149 "specVersion": "1.5",
150 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
151 "version": 1,
152 "metadata": {
153 "timestamp": "2020-01-01T00:00:00.000Z",
154 "lifecycles": [
155 {
156 "phase": "build"
157 }
158 ],
159 "tools": [
160 {
161 "vendor": "npm",
162 "name": "cli",
163 "version": "10.0.0 "
164 }
165 ],
166 "component": {
167 "bom-ref": "[email protected]",
168 "type": "library",
169 "name": "root",
170 "version": "1.0.0",
171 "scope": "required",
172 "author": "Author",
173 "purl": "pkg:npm/[email protected]",
174 "properties": [],
175 "externalReferences": []
176 }
177 },
178 "components": [
179 {
180 "bom-ref": "[email protected]",
181 "type": "library",
182 "name": "dep1",
183 "version": "0.0.1",
184 "scope": "required",
185 "purl": "pkg:npm/[email protected]",
186 "properties": [],
187 "externalReferences": []
188 }
189 ],
190 "dependencies": [
191 {
192 "ref": "[email protected]",
193 "dependsOn": [
194 "[email protected]"
195 ]
196 },
197 {
198 "ref": "[email protected]",
199 "dependsOn": []
200 }
201 ]
202 }
203 `
204
205 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - application package type > must match snapshot 1`] = `
206 {
207 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
208 "bomFormat": "CycloneDX",
209 "specVersion": "1.5",
210 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
211 "version": 1,
212 "metadata": {
213 "timestamp": "2020-01-01T00:00:00.000Z",
214 "lifecycles": [
215 {
216 "phase": "build"
217 }
218 ],
219 "tools": [
220 {
221 "vendor": "npm",
222 "name": "cli",
223 "version": "10.0.0 "
224 }
225 ],
226 "component": {
227 "bom-ref": "[email protected]",
228 "type": "application",
229 "name": "root",
230 "version": "1.0.0",
231 "scope": "required",
232 "author": "Author",
233 "purl": "pkg:npm/[email protected]",
234 "properties": [],
235 "externalReferences": []
236 }
237 },
238 "components": [],
239 "dependencies": [
240 {
241 "ref": "[email protected]",
242 "dependsOn": []
243 }
244 ]
245 }
246 `
247
248 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - bundled > must match snapshot 1`] = `
249 {
250 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
251 "bomFormat": "CycloneDX",
252 "specVersion": "1.5",
253 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
254 "version": 1,
255 "metadata": {
256 "timestamp": "2020-01-01T00:00:00.000Z",
257 "lifecycles": [
258 {
259 "phase": "build"
260 }
261 ],
262 "tools": [
263 {
264 "vendor": "npm",
265 "name": "cli",
266 "version": "10.0.0 "
267 }
268 ],
269 "component": {
270 "bom-ref": "[email protected]",
271 "type": "library",
272 "name": "root",
273 "version": "1.0.0",
274 "scope": "required",
275 "author": "Author",
276 "purl": "pkg:npm/[email protected]",
277 "properties": [
278 {
279 "name": "cdx:npm:package:bundled",
280 "value": "true"
281 }
282 ],
283 "externalReferences": []
284 }
285 },
286 "components": [],
287 "dependencies": [
288 {
289 "ref": "[email protected]",
290 "dependsOn": []
291 }
292 ]
293 }
294 `
295
296 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - development > must match snapshot 1`] = `
297 {
298 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
299 "bomFormat": "CycloneDX",
300 "specVersion": "1.5",
301 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
302 "version": 1,
303 "metadata": {
304 "timestamp": "2020-01-01T00:00:00.000Z",
305 "lifecycles": [
306 {
307 "phase": "build"
308 }
309 ],
310 "tools": [
311 {
312 "vendor": "npm",
313 "name": "cli",
314 "version": "10.0.0 "
315 }
316 ],
317 "component": {
318 "bom-ref": "[email protected]",
319 "type": "library",
320 "name": "root",
321 "version": "1.0.0",
322 "scope": "required",
323 "author": "Author",
324 "purl": "pkg:npm/[email protected]",
325 "properties": [
326 {
327 "name": "cdx:npm:package:development",
328 "value": "true"
329 }
330 ],
331 "externalReferences": []
332 }
333 },
334 "components": [],
335 "dependencies": [
336 {
337 "ref": "[email protected]",
338 "dependsOn": []
339 }
340 ]
341 }
342 `
343
344 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - extraneous > must match snapshot 1`] = `
345 {
346 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
347 "bomFormat": "CycloneDX",
348 "specVersion": "1.5",
349 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
350 "version": 1,
351 "metadata": {
352 "timestamp": "2020-01-01T00:00:00.000Z",
353 "lifecycles": [
354 {
355 "phase": "build"
356 }
357 ],
358 "tools": [
359 {
360 "vendor": "npm",
361 "name": "cli",
362 "version": "10.0.0 "
363 }
364 ],
365 "component": {
366 "bom-ref": "[email protected]",
367 "type": "library",
368 "name": "root",
369 "version": "1.0.0",
370 "scope": "required",
371 "author": "Author",
372 "purl": "pkg:npm/[email protected]",
373 "properties": [
374 {
375 "name": "cdx:npm:package:extraneous",
376 "value": "true"
377 }
378 ],
379 "externalReferences": []
380 }
381 },
382 "components": [],
383 "dependencies": [
384 {
385 "ref": "[email protected]",
386 "dependsOn": []
387 }
388 ]
389 }
390 `
391
392 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - from git url > must match snapshot 1`] = `
393 {
394 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
395 "bomFormat": "CycloneDX",
396 "specVersion": "1.5",
397 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
398 "version": 1,
399 "metadata": {
400 "timestamp": "2020-01-01T00:00:00.000Z",
401 "lifecycles": [
402 {
403 "phase": "build"
404 }
405 ],
406 "tools": [
407 {
408 "vendor": "npm",
409 "name": "cli",
410 "version": "10.0.0 "
411 }
412 ],
413 "component": {
414 "bom-ref": "[email protected]",
415 "type": "library",
416 "name": "root",
417 "version": "1.0.0",
418 "scope": "required",
419 "author": "Author",
420 "purl": "pkg:npm/[email protected]?vcs_url=https://github.com/foo/bar#1234",
421 "properties": [],
422 "externalReferences": [
423 {
424 "type": "distribution",
425 "url": "https://github.com/foo/bar#1234"
426 }
427 ]
428 }
429 },
430 "components": [],
431 "dependencies": [
432 {
433 "ref": "[email protected]",
434 "dependsOn": []
435 }
436 ]
437 }
438 `
439
440 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - no package info > must match snapshot 1`] = `
441 {
442 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
443 "bomFormat": "CycloneDX",
444 "specVersion": "1.5",
445 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
446 "version": 1,
447 "metadata": {
448 "timestamp": "2020-01-01T00:00:00.000Z",
449 "lifecycles": [
450 {
451 "phase": "build"
452 }
453 ],
454 "tools": [
455 {
456 "vendor": "npm",
457 "name": "cli",
458 "version": "10.0.0 "
459 }
460 ],
461 "component": {
462 "bom-ref": "[email protected]",
463 "type": "library",
464 "name": "root",
465 "version": "1.0.0",
466 "scope": "required",
467 "purl": "pkg:npm/[email protected]",
468 "properties": [],
469 "externalReferences": []
470 }
471 },
472 "components": [],
473 "dependencies": [
474 {
475 "ref": "[email protected]",
476 "dependsOn": []
477 }
478 ]
479 }
480 `
481
482 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - optional > must match snapshot 1`] = `
483 {
484 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
485 "bomFormat": "CycloneDX",
486 "specVersion": "1.5",
487 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
488 "version": 1,
489 "metadata": {
490 "timestamp": "2020-01-01T00:00:00.000Z",
491 "lifecycles": [
492 {
493 "phase": "build"
494 }
495 ],
496 "tools": [
497 {
498 "vendor": "npm",
499 "name": "cli",
500 "version": "10.0.0 "
501 }
502 ],
503 "component": {
504 "bom-ref": "[email protected]",
505 "type": "library",
506 "name": "root",
507 "version": "1.0.0",
508 "scope": "optional",
509 "author": "Author",
510 "purl": "pkg:npm/[email protected]",
511 "properties": [],
512 "externalReferences": []
513 }
514 },
515 "components": [],
516 "dependencies": [
517 {
518 "ref": "[email protected]",
519 "dependsOn": []
520 }
521 ]
522 }
523 `
524
525 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - package lock only > must match snapshot 1`] = `
526 {
527 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
528 "bomFormat": "CycloneDX",
529 "specVersion": "1.5",
530 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
531 "version": 1,
532 "metadata": {
533 "timestamp": "2020-01-01T00:00:00.000Z",
534 "lifecycles": [
535 {
536 "phase": "pre-build"
537 }
538 ],
539 "tools": [
540 {
541 "vendor": "npm",
542 "name": "cli",
543 "version": "10.0.0 "
544 }
545 ],
546 "component": {
547 "bom-ref": "[email protected]",
548 "type": "library",
549 "name": "root",
550 "version": "1.0.0",
551 "scope": "required",
552 "author": "Author",
553 "purl": "pkg:npm/[email protected]",
554 "properties": [],
555 "externalReferences": []
556 }
557 },
558 "components": [],
559 "dependencies": [
560 {
561 "ref": "[email protected]",
562 "dependsOn": []
563 }
564 ]
565 }
566 `
567
568 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - private > must match snapshot 1`] = `
569 {
570 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
571 "bomFormat": "CycloneDX",
572 "specVersion": "1.5",
573 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
574 "version": 1,
575 "metadata": {
576 "timestamp": "2020-01-01T00:00:00.000Z",
577 "lifecycles": [
578 {
579 "phase": "build"
580 }
581 ],
582 "tools": [
583 {
584 "vendor": "npm",
585 "name": "cli",
586 "version": "10.0.0 "
587 }
588 ],
589 "component": {
590 "bom-ref": "[email protected]",
591 "type": "library",
592 "name": "root",
593 "version": "1.0.0",
594 "scope": "required",
595 "author": "Author",
596 "purl": "pkg:npm/[email protected]",
597 "properties": [
598 {
599 "name": "cdx:npm:package:private",
600 "value": "true"
601 }
602 ],
603 "externalReferences": []
604 }
605 },
606 "components": [],
607 "dependencies": [
608 {
609 "ref": "[email protected]",
610 "dependsOn": []
611 }
612 ]
613 }
614 `
615
616 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with author object > must match snapshot 1`] = `
617 {
618 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
619 "bomFormat": "CycloneDX",
620 "specVersion": "1.5",
621 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
622 "version": 1,
623 "metadata": {
624 "timestamp": "2020-01-01T00:00:00.000Z",
625 "lifecycles": [
626 {
627 "phase": "build"
628 }
629 ],
630 "tools": [
631 {
632 "vendor": "npm",
633 "name": "cli",
634 "version": "10.0.0 "
635 }
636 ],
637 "component": {
638 "bom-ref": "[email protected]",
639 "type": "library",
640 "name": "root",
641 "version": "1.0.0",
642 "scope": "required",
643 "author": "Arthur",
644 "purl": "pkg:npm/[email protected]",
645 "properties": [],
646 "externalReferences": []
647 }
648 },
649 "components": [],
650 "dependencies": [
651 {
652 "ref": "[email protected]",
653 "dependsOn": []
654 }
655 ]
656 }
657 `
658
659 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with description > must match snapshot 1`] = `
660 {
661 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
662 "bomFormat": "CycloneDX",
663 "specVersion": "1.5",
664 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
665 "version": 1,
666 "metadata": {
667 "timestamp": "2020-01-01T00:00:00.000Z",
668 "lifecycles": [
669 {
670 "phase": "build"
671 }
672 ],
673 "tools": [
674 {
675 "vendor": "npm",
676 "name": "cli",
677 "version": "10.0.0 "
678 }
679 ],
680 "component": {
681 "bom-ref": "[email protected]",
682 "type": "library",
683 "name": "root",
684 "version": "1.0.0",
685 "scope": "required",
686 "author": "Author",
687 "description": "Package description",
688 "purl": "pkg:npm/[email protected]",
689 "properties": [],
690 "externalReferences": []
691 }
692 },
693 "components": [],
694 "dependencies": [
695 {
696 "ref": "[email protected]",
697 "dependsOn": []
698 }
699 ]
700 }
701 `
702
703 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with distribution url > must match snapshot 1`] = `
704 {
705 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
706 "bomFormat": "CycloneDX",
707 "specVersion": "1.5",
708 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
709 "version": 1,
710 "metadata": {
711 "timestamp": "2020-01-01T00:00:00.000Z",
712 "lifecycles": [
713 {
714 "phase": "build"
715 }
716 ],
717 "tools": [
718 {
719 "vendor": "npm",
720 "name": "cli",
721 "version": "10.0.0 "
722 }
723 ],
724 "component": {
725 "bom-ref": "[email protected]",
726 "type": "library",
727 "name": "root",
728 "version": "1.0.0",
729 "scope": "required",
730 "author": "Author",
731 "purl": "pkg:npm/[email protected]",
732 "properties": [],
733 "externalReferences": [
734 {
735 "type": "distribution",
736 "url": "https://registry.npmjs.org/root/-/root-1.0.0.tgz"
737 }
738 ]
739 }
740 },
741 "components": [],
742 "dependencies": [
743 {
744 "ref": "[email protected]",
745 "dependsOn": []
746 }
747 ]
748 }
749 `
750
751 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with homepage > must match snapshot 1`] = `
752 {
753 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
754 "bomFormat": "CycloneDX",
755 "specVersion": "1.5",
756 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
757 "version": 1,
758 "metadata": {
759 "timestamp": "2020-01-01T00:00:00.000Z",
760 "lifecycles": [
761 {
762 "phase": "build"
763 }
764 ],
765 "tools": [
766 {
767 "vendor": "npm",
768 "name": "cli",
769 "version": "10.0.0 "
770 }
771 ],
772 "component": {
773 "bom-ref": "[email protected]",
774 "type": "library",
775 "name": "root",
776 "version": "1.0.0",
777 "scope": "required",
778 "author": "Author",
779 "purl": "pkg:npm/[email protected]",
780 "properties": [],
781 "externalReferences": [
782 {
783 "type": "website",
784 "url": "https://foo.bar/README.md"
785 }
786 ]
787 }
788 },
789 "components": [],
790 "dependencies": [
791 {
792 "ref": "[email protected]",
793 "dependsOn": []
794 }
795 ]
796 }
797 `
798
799 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with integrity > must match snapshot 1`] = `
800 {
801 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
802 "bomFormat": "CycloneDX",
803 "specVersion": "1.5",
804 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
805 "version": 1,
806 "metadata": {
807 "timestamp": "2020-01-01T00:00:00.000Z",
808 "lifecycles": [
809 {
810 "phase": "build"
811 }
812 ],
813 "tools": [
814 {
815 "vendor": "npm",
816 "name": "cli",
817 "version": "10.0.0 "
818 }
819 ],
820 "component": {
821 "bom-ref": "[email protected]",
822 "type": "library",
823 "name": "root",
824 "version": "1.0.0",
825 "scope": "required",
826 "author": "Author",
827 "purl": "pkg:npm/[email protected]",
828 "properties": [],
829 "externalReferences": [],
830 "hashes": [
831 {
832 "alg": "SHA-512",
833 "content": "d5191b14650a7b1e25bec07dca121f5a5b493397192947ed07678d6a3683bf7742304a78f62046d0ad78b87f0d9d7f483eec76fa62bb24610e0748e7e3cfc9eb"
834 }
835 ]
836 }
837 },
838 "components": [],
839 "dependencies": [
840 {
841 "ref": "[email protected]",
842 "dependsOn": []
843 }
844 ]
845 }
846 `
847
848 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with issue tracker > must match snapshot 1`] = `
849 {
850 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
851 "bomFormat": "CycloneDX",
852 "specVersion": "1.5",
853 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
854 "version": 1,
855 "metadata": {
856 "timestamp": "2020-01-01T00:00:00.000Z",
857 "lifecycles": [
858 {
859 "phase": "build"
860 }
861 ],
862 "tools": [
863 {
864 "vendor": "npm",
865 "name": "cli",
866 "version": "10.0.0 "
867 }
868 ],
869 "component": {
870 "bom-ref": "[email protected]",
871 "type": "library",
872 "name": "root",
873 "version": "1.0.0",
874 "scope": "required",
875 "author": "Author",
876 "purl": "pkg:npm/[email protected]",
877 "properties": [],
878 "externalReferences": [
879 {
880 "type": "issue-tracker",
881 "url": "https://foo.bar/issues"
882 }
883 ]
884 }
885 },
886 "components": [],
887 "dependencies": [
888 {
889 "ref": "[email protected]",
890 "dependsOn": []
891 }
892 ]
893 }
894 `
895
896 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with legacy licenses array (multiple) > must match snapshot 1`] = `
897 {
898 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
899 "bomFormat": "CycloneDX",
900 "specVersion": "1.5",
901 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
902 "version": 1,
903 "metadata": {
904 "timestamp": "2020-01-01T00:00:00.000Z",
905 "lifecycles": [
906 {
907 "phase": "build"
908 }
909 ],
910 "tools": [
911 {
912 "vendor": "npm",
913 "name": "cli",
914 "version": "10.0.0 "
915 }
916 ],
917 "component": {
918 "bom-ref": "[email protected]",
919 "type": "library",
920 "name": "root",
921 "version": "1.0.0",
922 "scope": "required",
923 "author": "Author",
924 "purl": "pkg:npm/[email protected]",
925 "properties": [],
926 "externalReferences": [],
927 "licenses": [
928 {
929 "expression": "MIT OR Apache-2.0"
930 }
931 ]
932 }
933 },
934 "components": [],
935 "dependencies": [
936 {
937 "ref": "[email protected]",
938 "dependsOn": []
939 }
940 ]
941 }
942 `
943
944 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with legacy licenses array (single) > must match snapshot 1`] = `
945 {
946 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
947 "bomFormat": "CycloneDX",
948 "specVersion": "1.5",
949 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
950 "version": 1,
951 "metadata": {
952 "timestamp": "2020-01-01T00:00:00.000Z",
953 "lifecycles": [
954 {
955 "phase": "build"
956 }
957 ],
958 "tools": [
959 {
960 "vendor": "npm",
961 "name": "cli",
962 "version": "10.0.0 "
963 }
964 ],
965 "component": {
966 "bom-ref": "[email protected]",
967 "type": "library",
968 "name": "root",
969 "version": "1.0.0",
970 "scope": "required",
971 "author": "Author",
972 "purl": "pkg:npm/[email protected]",
973 "properties": [],
974 "externalReferences": [],
975 "licenses": [
976 {
977 "license": {
978 "id": "MIT"
979 }
980 }
981 ]
982 }
983 },
984 "components": [],
985 "dependencies": [
986 {
987 "ref": "[email protected]",
988 "dependsOn": []
989 }
990 ]
991 }
992 `
993
994 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with legacy licenses array (string entries) > must match snapshot 1`] = `
995 {
996 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
997 "bomFormat": "CycloneDX",
998 "specVersion": "1.5",
999 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
1000 "version": 1,
1001 "metadata": {
1002 "timestamp": "2020-01-01T00:00:00.000Z",
1003 "lifecycles": [
1004 {
1005 "phase": "build"
1006 }
1007 ],
1008 "tools": [
1009 {
1010 "vendor": "npm",
1011 "name": "cli",
1012 "version": "10.0.0 "
1013 }
1014 ],
1015 "component": {
1016 "bom-ref": "[email protected]",
1017 "type": "library",
1018 "name": "root",
1019 "version": "1.0.0",
1020 "scope": "required",
1021 "author": "Author",
1022 "purl": "pkg:npm/[email protected]",
1023 "properties": [],
1024 "externalReferences": [],
1025 "licenses": [
1026 {
1027 "license": {
1028 "id": "MIT"
1029 }
1030 }
1031 ]
1032 }
1033 },
1034 "components": [],
1035 "dependencies": [
1036 {
1037 "ref": "[email protected]",
1038 "dependsOn": []
1039 }
1040 ]
1041 }
1042 `
1043
1044 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with license expression > must match snapshot 1`] = `
1045 {
1046 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
1047 "bomFormat": "CycloneDX",
1048 "specVersion": "1.5",
1049 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
1050 "version": 1,
1051 "metadata": {
1052 "timestamp": "2020-01-01T00:00:00.000Z",
1053 "lifecycles": [
1054 {
1055 "phase": "build"
1056 }
1057 ],
1058 "tools": [
1059 {
1060 "vendor": "npm",
1061 "name": "cli",
1062 "version": "10.0.0 "
1063 }
1064 ],
1065 "component": {
1066 "bom-ref": "[email protected]",
1067 "type": "library",
1068 "name": "root",
1069 "version": "1.0.0",
1070 "scope": "required",
1071 "author": "Author",
1072 "purl": "pkg:npm/[email protected]",
1073 "properties": [],
1074 "externalReferences": [],
1075 "licenses": [
1076 {
1077 "expression": "(MIT OR Apache-2.0)"
1078 }
1079 ]
1080 }
1081 },
1082 "components": [],
1083 "dependencies": [
1084 {
1085 "ref": "[email protected]",
1086 "dependsOn": []
1087 }
1088 ]
1089 }
1090 `
1091
1092 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with license object > must match snapshot 1`] = `
1093 {
1094 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
1095 "bomFormat": "CycloneDX",
1096 "specVersion": "1.5",
1097 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
1098 "version": 1,
1099 "metadata": {
1100 "timestamp": "2020-01-01T00:00:00.000Z",
1101 "lifecycles": [
1102 {
1103 "phase": "build"
1104 }
1105 ],
1106 "tools": [
1107 {
1108 "vendor": "npm",
1109 "name": "cli",
1110 "version": "10.0.0 "
1111 }
1112 ],
1113 "component": {
1114 "bom-ref": "[email protected]",
1115 "type": "library",
1116 "name": "root",
1117 "version": "1.0.0",
1118 "scope": "required",
1119 "author": "Author",
1120 "purl": "pkg:npm/[email protected]",
1121 "properties": [],
1122 "externalReferences": [],
1123 "licenses": [
1124 {
1125 "license": {
1126 "id": "MIT"
1127 }
1128 }
1129 ]
1130 }
1131 },
1132 "components": [],
1133 "dependencies": [
1134 {
1135 "ref": "[email protected]",
1136 "dependsOn": []
1137 }
1138 ]
1139 }
1140 `
1141
1142 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with repository url > must match snapshot 1`] = `
1143 {
1144 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
1145 "bomFormat": "CycloneDX",
1146 "specVersion": "1.5",
1147 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
1148 "version": 1,
1149 "metadata": {
1150 "timestamp": "2020-01-01T00:00:00.000Z",
1151 "lifecycles": [
1152 {
1153 "phase": "build"
1154 }
1155 ],
1156 "tools": [
1157 {
1158 "vendor": "npm",
1159 "name": "cli",
1160 "version": "10.0.0 "
1161 }
1162 ],
1163 "component": {
1164 "bom-ref": "[email protected]",
1165 "type": "library",
1166 "name": "root",
1167 "version": "1.0.0",
1168 "scope": "required",
1169 "author": "Author",
1170 "purl": "pkg:npm/[email protected]",
1171 "properties": [],
1172 "externalReferences": [
1173 {
1174 "type": "vcs",
1175 "url": "https://foo.bar"
1176 }
1177 ]
1178 }
1179 },
1180 "components": [],
1181 "dependencies": [
1182 {
1183 "ref": "[email protected]",
1184 "dependsOn": []
1185 }
1186 ]
1187 }
1188 `
1189
1190 exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with single license > must match snapshot 1`] = `
1191 {
1192 "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
1193 "bomFormat": "CycloneDX",
1194 "specVersion": "1.5",
1195 "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000",
1196 "version": 1,
1197 "metadata": {
1198 "timestamp": "2020-01-01T00:00:00.000Z",
1199 "lifecycles": [
1200 {
1201 "phase": "build"
1202 }
1203 ],
1204 "tools": [
1205 {
1206 "vendor": "npm",
1207 "name": "cli",
1208 "version": "10.0.0 "
1209 }
1210 ],
1211 "component": {
1212 "bom-ref": "[email protected]",
1213 "type": "library",
1214 "name": "root",
1215 "version": "1.0.0",
1216 "scope": "required",
1217 "author": "Author",
1218 "purl": "pkg:npm/[email protected]",
1219 "properties": [],
1220 "externalReferences": [],
1221 "licenses": [
1222 {
1223 "license": {
1224 "id": "ISC"
1225 }
1226 }
1227 ]
1228 }
1229 },
1230 "components": [],
1231 "dependencies": [
1232 {
1233 "ref": "[email protected]",
1234 "dependsOn": []
1235 }
1236 ]
1237 }
1238 `