@peertube/feed 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,836 @@
1
+ import { Feed } from "../feed"
2
+ import { IntegrityType, LiveItemStatus } from "../typings"
3
+ import { published, sampleFeed, updated } from "./setup"
4
+
5
+ describe("podcast", () => {
6
+ it("should generate a valid feed", () => {
7
+ const actual = sampleFeed.podcast()
8
+ expect(actual).toMatchSnapshot()
9
+ })
10
+ it("should generate a valid feed author no link", () => {
11
+ const sampleFeed = new Feed({
12
+ title: "Feed Title",
13
+ copyright: "All rights reserved 2013, John Doe",
14
+ updated,
15
+ author: {
16
+ name: "John Doe",
17
+ email: "johndoe@example.com",
18
+ },
19
+ customXMLNS: [
20
+ {
21
+ name: "biz",
22
+ value: "http://example.com/biz-xmlns"
23
+ },
24
+ ],
25
+ })
26
+ const actual = sampleFeed.podcast()
27
+ expect(actual).toMatchSnapshot()
28
+
29
+ })
30
+ it("should generate a valid feed managingEditor", () => {
31
+ const sampleFeed = new Feed({
32
+ title: "Feed Title",
33
+ copyright: "All rights reserved 2013, John Doe",
34
+ updated,
35
+ managingEditor: {
36
+ name: "John Doe",
37
+ email: "johndoe@example.com",
38
+ },
39
+ customXMLNS: [
40
+ {
41
+ name: "biz",
42
+ value: "http://example.com/biz-xmlns"
43
+ },
44
+ ],
45
+ })
46
+ const actual = sampleFeed.podcast()
47
+ expect(actual).toMatchSnapshot()
48
+ })
49
+ it("should generate a valid feed webMaster", () => {
50
+ const sampleFeed = new Feed({
51
+ title: "Feed Title",
52
+ copyright: "All rights reserved 2013, John Doe",
53
+ updated,
54
+ webMaster: {
55
+ name: "John Doe",
56
+ email: "johndoe@example.com",
57
+ },
58
+ customXMLNS: [
59
+ {
60
+ name: "biz",
61
+ value: "http://example.com/biz-xmlns"
62
+ },
63
+ ],
64
+ })
65
+ const actual = sampleFeed.podcast()
66
+ expect(actual).toMatchSnapshot()
67
+ })
68
+ it("should generate a valid feed medium music", () => {
69
+ const sampleFeed = new Feed({
70
+ title: "Feed Title",
71
+ copyright: "All rights reserved 2013, John Doe",
72
+ medium: "music",
73
+ updated,
74
+ author: {
75
+ name: "John Doe",
76
+ email: "johndoe@example.com",
77
+ link: "https://example.com/hello-world?link=sanitized&value=2",
78
+ },
79
+ customXMLNS: [
80
+ {
81
+ name: "biz",
82
+ value: "http://example.com/biz-xmlns"
83
+ },
84
+ ],
85
+ })
86
+ const actual = sampleFeed.podcast()
87
+ expect(actual).toMatchSnapshot()
88
+ })
89
+ it("should generate a valid feed person", () => {
90
+ const sampleFeed = new Feed({
91
+ title: "Feed Title",
92
+ copyright: "All rights reserved 2013, John Doe",
93
+ updated,
94
+ person: [
95
+ {
96
+ name: "John Doe",
97
+ href: "https://example.com/hello-world?link=sanitized&value=2",
98
+ img: "https://example.com/john-doe.png",
99
+ },
100
+ ],
101
+ locked: { isLocked: true, email: "johndoe@example.com" },
102
+ customXMLNS: [
103
+ {
104
+ name: "biz",
105
+ value: "http://example.com/biz-xmlns"
106
+ },
107
+ ],
108
+ })
109
+ const actual = sampleFeed.podcast()
110
+ expect(actual).toMatchSnapshot()
111
+ })
112
+ it("should generate a valid feed guid", () => {
113
+ const sampleFeed = new Feed({
114
+ title: "Feed Title",
115
+ guid: "81db299a-e533-45a4-a2c1-59fd9501713a",
116
+ copyright: "All rights reserved 2013, John Doe",
117
+ updated,
118
+ customXMLNS: [
119
+ {
120
+ name: "biz",
121
+ value: "http://example.com/biz-xmlns"
122
+ },
123
+ ],
124
+ })
125
+ const actual = sampleFeed.podcast()
126
+ expect(actual).toMatchSnapshot()
127
+ })
128
+ it("should generate a valid feed locked", () => {
129
+ const sampleFeed = new Feed({
130
+ title: "Feed Title",
131
+ copyright: "All rights reserved 2013, John Doe",
132
+ updated,
133
+ locked: { isLocked: true, email: "johndoe@example.com" },
134
+ customXMLNS: [
135
+ {
136
+ name: "biz",
137
+ value: "http://example.com/biz-xmlns"
138
+ },
139
+ ],
140
+ })
141
+ const actual = sampleFeed.podcast()
142
+ expect(actual).toMatchSnapshot()
143
+ })
144
+ it("should generate a valid feed not locked", () => {
145
+ const sampleFeed = new Feed({
146
+ title: "Feed Title",
147
+ copyright: "All rights reserved 2013, John Doe",
148
+ updated,
149
+ locked: { isLocked: false, email: "johndoe@example.com" },
150
+ customXMLNS: [
151
+ {
152
+ name: "biz",
153
+ value: "http://example.com/biz-xmlns"
154
+ },
155
+ ],
156
+ })
157
+ const actual = sampleFeed.podcast()
158
+ expect(actual).toMatchSnapshot()
159
+ })
160
+ it("should generate a valid feed with stun servers", () => {
161
+ const sampleFeed = new Feed({
162
+ title: "Feed Title",
163
+ copyright: "All rights reserved 2013, John Doe",
164
+ updated,
165
+ locked: { isLocked: false, email: "johndoe@example.com" },
166
+ stunServers: [
167
+ "stun:stun1.l.google.com:19302",
168
+ "stun:stunserver.org:3478",
169
+ ]
170
+ })
171
+ const actual = sampleFeed.podcast()
172
+ expect(actual).toMatchSnapshot()
173
+ })
174
+ it("should generate a valid feed with trackers", () => {
175
+ const sampleFeed = new Feed({
176
+ title: "Feed Title",
177
+ copyright: "All rights reserved 2013, John Doe",
178
+ updated,
179
+ locked: { isLocked: false, email: "johndoe@example.com" },
180
+ trackers: [
181
+ "https://opentracker.i2p.rocks:443/announce",
182
+ "udp://tracker.opentrackr.org:1337/announce",
183
+ ]
184
+ })
185
+ const actual = sampleFeed.podcast()
186
+ expect(actual).toMatchSnapshot()
187
+ })
188
+ it("should generate a valid feed with custom channel tags", () => {
189
+ const sampleFeed = new Feed({
190
+ title: "Feed Title",
191
+ copyright: "All rights reserved 2013, John Doe",
192
+ updated,
193
+ customXMLNS: [
194
+ {
195
+ name: "biz",
196
+ value: "http://example.com/biz-xmlns"
197
+ }
198
+ ],
199
+ customTags: [
200
+ {
201
+ name: "fooTag",
202
+ attributes: { "bar": "baz" },
203
+ },
204
+ {
205
+ name: "fooTag",
206
+ attributes: { "bar": "baz" },
207
+ value: "42",
208
+ },
209
+ {
210
+ name: "biz:buzzItem",
211
+ value: "43",
212
+ cdata: true,
213
+ },
214
+ {
215
+ name: "biz:buzzItem",
216
+ value: [
217
+ {
218
+ name: "exampleTag",
219
+ value: "example tag with cdata",
220
+ cdata: true,
221
+ },
222
+ ],
223
+ },
224
+ {
225
+ name: "biz:buzzItem",
226
+ value: [
227
+ {
228
+ name: "exampleTag",
229
+ value: "example tag without cdata",
230
+ },
231
+ ],
232
+ cdata: true,
233
+ },
234
+ ]
235
+ })
236
+ const actual = sampleFeed.podcast()
237
+ expect(actual).toMatchSnapshot()
238
+ })
239
+ it("should generate a valid feed with a podcast item", () => {
240
+ sampleFeed.addPodcastItem({
241
+ title: "Hello World",
242
+ link: "https://example.com/hello-world?link=sanitized&value=2",
243
+ description: "This is an article about Hello World.",
244
+ content: "Content of my item",
245
+ author: [
246
+ {
247
+ name: "Jane Doe",
248
+ email: "janedoe@example.com",
249
+ link: "https://example.com/janedoe",
250
+ },
251
+ {
252
+ name: "Joe Smith",
253
+ email: "joesmith@example.com",
254
+ link: "https://example.com/joesmith",
255
+ },
256
+ {
257
+ name: "Joe Smith, Name Only",
258
+ },
259
+ ],
260
+ category: [
261
+ {
262
+ name: "Grateful Dead",
263
+ },
264
+ {
265
+ name: "MSFT",
266
+ domain: "http://www.fool.com/cusips",
267
+ },
268
+ ],
269
+ media: [
270
+ {
271
+ type: "audio/mpeg",
272
+ length: 12345,
273
+ sources: [
274
+ { uri: "https://example.com/hello-world.mp3", },
275
+ ],
276
+ },
277
+ ],
278
+ date: updated,
279
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
280
+ published,
281
+ nsfw: false,
282
+ })
283
+ const actual = sampleFeed.podcast()
284
+ expect(actual).toMatchSnapshot()
285
+ })
286
+ it("should generate a valid feed with a podcast item socialInteract", () => {
287
+ sampleFeed.addPodcastItem({
288
+ title: "Hello World",
289
+ link: "https://example.com/hello-world2",
290
+ description: "This is an article about Hello World.",
291
+ socialInteract: [
292
+ {
293
+ uri: "https://example.com/@john/1234",
294
+ protocol: "activitypub",
295
+ accountId: "@john",
296
+ accountUrl: "https://example.com/@john",
297
+ priority: 1
298
+ },
299
+ {
300
+ uri: "https://twitter.com/example_account/status/42",
301
+ protocol: "twitter",
302
+ priority: 2
303
+ },
304
+ ],
305
+ media: [
306
+ {
307
+ type: "audio/mpeg",
308
+ length: 12345,
309
+ sources: [
310
+ { uri: "https://example.com/hello-world.mp3", },
311
+ ],
312
+ },
313
+ ],
314
+ date: updated,
315
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
316
+ published,
317
+ nsfw: false,
318
+ })
319
+ const actual = sampleFeed.podcast()
320
+ expect(actual).toMatchSnapshot()
321
+ })
322
+ it("should generate a valid feed with a podcast item explicit", () => {
323
+ const sampleFeed = new Feed({
324
+ title: "Feed Title",
325
+ copyright: "All rights reserved 2013, John Doe",
326
+ updated,
327
+ nsfw: true,
328
+ customXMLNS: [
329
+ {
330
+ name: "biz",
331
+ value: "http://example.com/biz-xmlns"
332
+ },
333
+ ],
334
+ })
335
+
336
+ sampleFeed.addPodcastItem({
337
+ title: "Hello World",
338
+ link: "https://example.com/hello-world3",
339
+ description: "This is an article about Hello World.",
340
+ media: [
341
+ {
342
+ type: "audio/mpeg",
343
+ length: 12345,
344
+ sources: [
345
+ { uri: "https://example.com/hello-world.mp3", },
346
+ ],
347
+ },
348
+ ],
349
+ date: updated,
350
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
351
+ published,
352
+ nsfw: true,
353
+ })
354
+ const actual = sampleFeed.podcast()
355
+ expect(actual).toMatchSnapshot()
356
+ })
357
+ it("should generate a valid feed with a podcast item guid", () => {
358
+ sampleFeed.addPodcastItem({
359
+ title: "Hello World",
360
+ guid: "42",
361
+ link: "https://example.com/hello-world4",
362
+ description: "This is an article about Hello World.",
363
+ media: [
364
+ {
365
+ type: "audio/mpeg",
366
+ length: 12345,
367
+ sources: [
368
+ { uri: "https://example.com/hello-world.mp3", },
369
+ ],
370
+ },
371
+ ],
372
+ date: updated,
373
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
374
+ published,
375
+ nsfw: false,
376
+ })
377
+ const actual = sampleFeed.podcast()
378
+ expect(actual).toMatchSnapshot()
379
+ })
380
+ it("should generate a valid feed with a podcast item with custom tags", () => {
381
+ sampleFeed.addPodcastItem({
382
+ title: "Hello World",
383
+ link: "https://example.com/hello-world4",
384
+ description: "This is an article about Hello World.",
385
+ media: [
386
+ {
387
+ type: "audio/mpeg",
388
+ length: 12345,
389
+ sources: [
390
+ { uri: "https://example.com/hello-world.mp3", },
391
+ ],
392
+ },
393
+ ],
394
+ date: updated,
395
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
396
+ published,
397
+ nsfw: false,
398
+ customTags: [
399
+ {
400
+ name: "fooTag",
401
+ attributes: { "bar": "baz" },
402
+ },
403
+ {
404
+ name: "fooTag",
405
+ attributes: { "bar": "baz" },
406
+ value: "42",
407
+ },
408
+ {
409
+ name: "biz:buzz",
410
+ value: "43",
411
+ cdata: true,
412
+ },
413
+ {
414
+ name: "biz:buzz",
415
+ attributes: { "bar": "https://foo?bar=baz&fizz='buzz'" },
416
+ },
417
+ {
418
+ name: "biz:buzz",
419
+ value: [
420
+ {
421
+ name: "exampleTag",
422
+ value: "example tag with cdata",
423
+ cdata: true,
424
+ },
425
+ ],
426
+ },
427
+ {
428
+ name: "biz:buzz",
429
+ value: [
430
+ {
431
+ name: "exampleTag",
432
+ value: "example tag without cdata",
433
+ },
434
+ ],
435
+ cdata: true,
436
+ },
437
+ {
438
+ name: "biz:buzz",
439
+ value: [
440
+ {
441
+ name: "biz:bar",
442
+ value: [
443
+ {
444
+ name: "biz:dwarfFortress",
445
+ value: "Losing is fun",
446
+ cdata: true,
447
+ },
448
+ ],
449
+ },
450
+ ],
451
+ },
452
+ ]
453
+ })
454
+ const actual = sampleFeed.podcast()
455
+ expect(actual).toMatchSnapshot()
456
+ })
457
+ it("should generate a valid feed with a podcast item guid enclosure", () => {
458
+ sampleFeed.addPodcastItem({
459
+ title: "Hello World",
460
+ link: "",
461
+ description: "This is an article about Hello World.",
462
+ media: [
463
+ {
464
+ type: "audio/mpeg",
465
+ length: 12345,
466
+ sources: [
467
+ { uri: "https://example.com/hello-world.mp3", },
468
+ ],
469
+ },
470
+ ],
471
+ date: updated,
472
+ thumbnails: [{ url: "https://example.com/hello-world.png", }],
473
+ published,
474
+ nsfw: false,
475
+ })
476
+ const actual = sampleFeed.podcast()
477
+ expect(actual).toMatchSnapshot()
478
+ })
479
+ it("should generate a valid feed with a podcast item images", () => {
480
+ sampleFeed.addPodcastItem({
481
+ title: "Hello World",
482
+ link: "https://example.com/hello-world5",
483
+ description: "This is an article about Hello World.",
484
+ media: [
485
+ {
486
+ type: "audio/mpeg",
487
+ length: 12345,
488
+ sources: [
489
+ { uri: "https://example.com/hello-world.mp3", },
490
+ ],
491
+ },
492
+ ],
493
+ date: updated,
494
+ thumbnails: [
495
+ { url: "https://example.com/images/ep1/pci_avatar-massive.jpg", width: 1500 },
496
+ { url: "https://example.com/images/ep1/pci_avatar-middle.jpg", width: 600 },
497
+ { url: "https://example.com/images/ep1/pci_avatar-small.jpg", width: 300 },
498
+ { url: "https://example.com/images/ep1/pci_avatar-tiny.jpg", width: 150 },
499
+ ],
500
+ published,
501
+ nsfw: false,
502
+ })
503
+ const actual = sampleFeed.podcast()
504
+ expect(actual).toMatchSnapshot()
505
+ })
506
+ it("should generate a valid feed with a podcast item transcript", () => {
507
+ sampleFeed.addPodcastItem({
508
+ title: "Hello World",
509
+ link: "https://example.com/hello-world14",
510
+ description: "This is an article about Hello World.",
511
+ media: [
512
+ {
513
+ type: "audio/mpeg",
514
+ length: 12345,
515
+ sources: [
516
+ { uri: "https://example.com/hello-world.mp3", },
517
+ ],
518
+ },
519
+ ],
520
+ date: updated,
521
+ subTitle: [
522
+ {
523
+ type: "text/vtt",
524
+ url: "https://example.com/hello-world-es.vtt",
525
+ language: "es",
526
+ rel: "captions"
527
+ }
528
+ ],
529
+ published,
530
+ nsfw: false,
531
+ })
532
+ const actual = sampleFeed.podcast()
533
+ expect(actual).toMatchSnapshot()
534
+ })
535
+ it("should generate a valid feed with a podcast item multiple enclosures", () => {
536
+ sampleFeed.addPodcastItem({
537
+ title: "Hello World",
538
+ link: "https://example.com/hello-world6",
539
+ description: "This is an article about Hello World.",
540
+ media: [
541
+ {
542
+ type: "audio/mpeg",
543
+ length: 12345,
544
+ sources: [
545
+ { uri: "https://example.com/hello-world.mp3", },
546
+ ],
547
+ },
548
+ {
549
+ type: "audio/opus",
550
+ length: 1234,
551
+ sources: [
552
+ { uri: "https://example.com/hello-world.opus", },
553
+ ],
554
+ },
555
+ ],
556
+ date: updated,
557
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
558
+ published,
559
+ })
560
+ const actual = sampleFeed.podcast()
561
+ expect(actual).toMatchSnapshot()
562
+ })
563
+
564
+ it("should generate a valid feed with a podcast item multiple sources", () => {
565
+ sampleFeed.addPodcastItem({
566
+ title: "Hello World",
567
+ link: "https://example.com/hello-world7",
568
+ description: "This is an article about Hello World.",
569
+ media: [
570
+ {
571
+ type: "audio/mpeg",
572
+ length: 12345,
573
+ sources: [
574
+ { uri: "https://example.com/hello-world.mp3", },
575
+ { uri: "https://example.com/hello-world-mp3.torrent", contentType: "application/x-bittorrent" },
576
+ ],
577
+ },
578
+ {
579
+ type: "audio/opus",
580
+ length: 1234,
581
+ sources: [
582
+ { uri: "https://example.com/hello-world.opus", },
583
+ { uri: "https://example.com/hello-world-opus.torrent", contentType: "application/x-bittorrent" },
584
+ ],
585
+ },
586
+ ],
587
+ date: updated,
588
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
589
+ published,
590
+ })
591
+ const actual = sampleFeed.podcast()
592
+ expect(actual).toMatchSnapshot()
593
+ })
594
+
595
+ it("should generate a valid feed with a podcast item enclosure integrity", () => {
596
+ sampleFeed.addPodcastItem({
597
+ title: "Hello World",
598
+ link: "https://example.com/hello-world8",
599
+ description: "This is an article about Hello World.",
600
+ media: [
601
+ {
602
+ type: "audio/mpeg",
603
+ length: 12345,
604
+ sources: [
605
+ { uri: "https://example.com/hello-world.mp3", },
606
+ ],
607
+ integrity: [
608
+ { type: IntegrityType.sri, value: "sha384-ExVqijgYHm15PqQqdXfW95x+Rs6C+d6E/ICxyQOeFevnxNLR/wtJNrNYTjIysUBo" },
609
+ { type: IntegrityType.pgpSignature, value: "pgp-signature-value-here" },
610
+ ]
611
+ },
612
+ ],
613
+ date: updated,
614
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
615
+ published,
616
+ })
617
+ const actual = sampleFeed.podcast()
618
+ expect(actual).toMatchSnapshot()
619
+ })
620
+
621
+ it("should generate a valid feed with a podcast item person", () => {
622
+ sampleFeed.addPodcastItem({
623
+ title: "Hello World",
624
+ link: "https://example.com/hello-world9",
625
+ description: "This is an article about Hello World.",
626
+ content: "Content of my item",
627
+ media: [
628
+ {
629
+ type: "audio/mpeg",
630
+ length: 12345,
631
+ sources: [
632
+ { uri: "https://example.com/hello-world.mp3", },
633
+ ],
634
+ },
635
+ ],
636
+ person: [
637
+ {
638
+ name: "Jane Doe",
639
+ img: "https://example.com/jane-doe.png",
640
+ href: "https://example.com/janedoe?link=sanitized&value=2",
641
+ role: "guest",
642
+ group: "visuals",
643
+ },
644
+ {
645
+ name: "John Smith",
646
+ img: "https://example.com/john-smith.png",
647
+ href: "https://example.com/johnsmith",
648
+ },
649
+ ],
650
+ date: updated,
651
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
652
+ published,
653
+ })
654
+ const actual = sampleFeed.podcast()
655
+ expect(actual).toMatchSnapshot()
656
+ })
657
+
658
+ it("should generate a valid feed with a podcast item stun servers", () => {
659
+ sampleFeed.addPodcastItem({
660
+ title: "Hello World",
661
+ link: "https://example.com/hello-world10",
662
+ description: "This is an article about Hello World.",
663
+ stunServers: [
664
+ "stun:stun.zoiper.com:3478",
665
+ "stun:stunserver.org:3478",
666
+ ],
667
+ media: [
668
+ {
669
+ type: "audio/mpeg",
670
+ length: 12345,
671
+ sources: [
672
+ { uri: "https://example.com/hello-world.mp3", },
673
+ { uri: "https://example.com/hello-world-mp3.torrent", contentType: "application/x-bittorrent" },
674
+ ],
675
+ },
676
+ ],
677
+ date: updated,
678
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
679
+ published,
680
+ })
681
+ const actual = sampleFeed.podcast()
682
+ expect(actual).toMatchSnapshot()
683
+ })
684
+
685
+ it("should generate a valid feed with a podcast item trackers", () => {
686
+ sampleFeed.addPodcastItem({
687
+ title: "Hello World",
688
+ link: "https://example.com/hello-world10",
689
+ description: "This is an article about Hello World.",
690
+ trackers: [
691
+ "udp://tracker.example.com:69420",
692
+ "wss://example.com/tracker/socket",
693
+ ],
694
+ media: [
695
+ {
696
+ type: "audio/mpeg",
697
+ length: 12345,
698
+ sources: [
699
+ { uri: "https://example.com/hello-world.mp3", },
700
+ { uri: "https://example.com/hello-world-mp3.torrent", contentType: "application/x-bittorrent" },
701
+ ],
702
+ },
703
+ ],
704
+ date: updated,
705
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
706
+ published,
707
+ })
708
+ const actual = sampleFeed.podcast()
709
+ expect(actual).toMatchSnapshot()
710
+ })
711
+ it("should generate a valid feed with a podcast liveItem pending", () => {
712
+ sampleFeed.addPodcastLiveItem({
713
+ title: "Hello World live pending",
714
+ link: "https://example.com/hello-world13",
715
+ guid: "some live episode 341234",
716
+ description: "This is an article about Hello World.",
717
+ content: "Content of my item",
718
+ author: [
719
+ {
720
+ name: "Jane Doe",
721
+ email: "janedoe@example.com",
722
+ link: "https://example.com/janedoe",
723
+ },
724
+ {
725
+ name: "Joe Smith",
726
+ email: "joesmith@example.com",
727
+ link: "https://example.com/joesmith",
728
+ },
729
+ ],
730
+ media: [
731
+ {
732
+ type: "audio/mpeg",
733
+ length: 12345,
734
+ sources: [
735
+ { uri: "https://example.com/hello-world.mp3", },
736
+ ],
737
+ },
738
+ ],
739
+ date: updated,
740
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
741
+ published,
742
+ nsfw: true,
743
+ status: LiveItemStatus.pending,
744
+ start: "2022-12-17T01:00:00.000Z",
745
+ })
746
+ const actual = sampleFeed.podcast()
747
+ expect(actual).toMatchSnapshot()
748
+ })
749
+ it("should generate a valid feed with a podcast liveItem", () => {
750
+ sampleFeed.addPodcastLiveItem({
751
+ title: "Hello World live",
752
+ link: "https://example.com/hello-world12",
753
+ guid: "some live episode 341235",
754
+ description: "This is an article about Hello World.",
755
+ content: "Content of my item",
756
+ author: [
757
+ {
758
+ name: "Jane Doe",
759
+ email: "janedoe@example.com",
760
+ link: "https://example.com/janedoe",
761
+ },
762
+ {
763
+ name: "Joe Smith",
764
+ email: "joesmith@example.com",
765
+ link: "https://example.com/joesmith",
766
+ },
767
+ ],
768
+ category: [
769
+ {
770
+ name: "Grateful Dead",
771
+ },
772
+ {
773
+ name: "MSFT",
774
+ domain: "http://www.fool.com/cusips",
775
+ },
776
+ ],
777
+ media: [
778
+ {
779
+ type: "audio/mpeg",
780
+ length: 12345,
781
+ sources: [
782
+ { uri: "https://example.com/hello-world.mp3", },
783
+ ],
784
+ },
785
+ ],
786
+ date: updated,
787
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
788
+ published,
789
+ nsfw: false,
790
+ status: LiveItemStatus.live,
791
+ start: "2022-12-16T01:10:43.562Z",
792
+ })
793
+ const actual = sampleFeed.podcast()
794
+ expect(actual).toMatchSnapshot()
795
+ })
796
+
797
+ it("should generate a valid feed with a podcast liveItem ended", () => {
798
+ sampleFeed.addPodcastLiveItem({
799
+ title: "Hello World live ended",
800
+ link: "https://example.com/hello-world11",
801
+ guid: "some live episode 341234",
802
+ description: "This is an article about Hello World.",
803
+ content: "Content of my item",
804
+ author: [
805
+ {
806
+ name: "Jane Doe",
807
+ email: "janedoe@example.com",
808
+ link: "https://example.com/janedoe",
809
+ },
810
+ {
811
+ name: "Joe Smith",
812
+ email: "joesmith@example.com",
813
+ link: "https://example.com/joesmith",
814
+ },
815
+ ],
816
+ media: [
817
+ {
818
+ type: "audio/mpeg",
819
+ length: 12345,
820
+ sources: [
821
+ { uri: "https://example.com/hello-world.mp3", },
822
+ ],
823
+ },
824
+ ],
825
+ date: updated,
826
+ thumbnails: [{ url: "https://example.com/hello-world.png" }],
827
+ published,
828
+ nsfw: false,
829
+ status: LiveItemStatus.ended,
830
+ start: "2022-12-15T01:01:00.000Z",
831
+ end: "2022-12-15T03:59:45.020Z",
832
+ })
833
+ const actual = sampleFeed.podcast()
834
+ expect(actual).toMatchSnapshot()
835
+ })
836
+ })