1
- import { ChaptersJson } from "../src/Formats/ChaptersJson.js" ;
2
- import { WebVTT } from "../src/Formats/WebVTT.js" ;
3
- import { Youtube } from "../src/Formats/Youtube.js" ;
4
- import { FFMetadata } from "../src/Formats/FFMetadata.js" ;
5
- import { MatroskaXML } from "../src/Formats/MatroskaXML.js" ;
6
- import { MKVMergeXML } from "../src/Formats/MKVMergeXML.js" ;
7
- import { MKVMergeSimple } from "../src/Formats/MKVMergeSimple.js" ;
8
- import { readFileSync } from "fs" ;
9
- import { sep } from "path" ;
10
- import { FFMpegInfo } from "../src/Formats/FFMpegInfo.js" ;
11
- import { AutoFormat } from "../src/Formats/AutoFormat.js" ;
1
+ import { ChaptersJson } from "../src/Formats/ChaptersJson.js" ;
2
+ import { WebVTT } from "../src/Formats/WebVTT.js" ;
3
+ import { Youtube } from "../src/Formats/Youtube.js" ;
4
+ import { FFMetadata } from "../src/Formats/FFMetadata.js" ;
5
+ import { MatroskaXML } from "../src/Formats/MatroskaXML.js" ;
6
+ import { MKVMergeXML } from "../src/Formats/MKVMergeXML.js" ;
7
+ import { MKVMergeSimple } from "../src/Formats/MKVMergeSimple.js" ;
8
+ import { readFileSync } from "fs" ;
9
+ import { sep } from "path" ;
10
+ import { FFMpegInfo } from "../src/Formats/FFMpegInfo.js" ;
11
+ import { AutoFormat } from "../src/Formats/AutoFormat.js" ;
12
+ import { AppleChapters } from "../src/Formats/AppleChapters.js" ;
13
+ import { MP4Chaps } from "../src/Formats/MP4Chaps.js" ;
14
+ import { PodloveSimpleChapters } from "../src/Formats/PodloveSimpleChapters.js" ;
15
+ import { PySceneDetect } from "../src/Formats/PySceneDetect.js" ;
16
+ import { ShutterEDL } from "../src/Formats/ShutterEDL.js" ;
17
+ import { VorbisComment } from "../src/Formats/VorbisComment.js" ;
18
+ import { PodloveJson } from "../src/Formats/PodloveJson.js" ;
12
19
13
20
describe ( 'autodetection of sample files' , ( ) => {
14
21
15
-
16
22
const filesAndKeysAndHandlers = [
23
+ [ 'applechapters.xml' , 'applechapters' , AppleChapters ] ,
17
24
[ 'chapters.json' , 'chaptersjson' , ChaptersJson ] ,
18
25
[ 'FFMetadata.txt' , 'ffmetadata' , FFMetadata ] ,
19
26
[ 'ffmpeginfo.txt' , 'ffmpeginfo' , FFMpegInfo ] ,
20
27
[ 'matroska.xml' , 'matroskaxml' , MatroskaXML ] ,
21
28
[ 'mkvmerge.simple.txt' , 'mkvmergesimple' , MKVMergeSimple ] ,
22
29
[ 'mkvmerge.xml' , 'mkvmergexml' , MKVMergeXML ] ,
30
+ [ 'mp4chaps.txt' , 'mp4chaps' , MP4Chaps ] ,
31
+ [ 'podlove-simple-chapters.xml' , 'psc' , PodloveSimpleChapters ] ,
32
+ [ 'podlove.json' , 'podlovejson' , PodloveJson ] ,
33
+ [ 'pyscenedetect.csv' , 'pyscenedetect' , PySceneDetect ] ,
34
+ [ 'shutter.edl' , 'shutteredl' , ShutterEDL ] ,
35
+ [ 'vorbiscomment.txt' , 'vorbiscomment' , VorbisComment ] ,
23
36
[ 'webvtt.txt' , 'webvtt' , WebVTT ] ,
24
- [ 'youtube-chapters.txt' , 'youtube' , Youtube ] ,
37
+ [ 'youtube-chapters.txt' , 'youtube' , Youtube ]
25
38
] ;
26
39
27
40
filesAndKeysAndHandlers . forEach ( item => {
@@ -62,32 +75,4 @@ describe('autodetection of sample files', () => {
62
75
63
76
} ) ;
64
77
65
-
66
- return ;
67
- /*
68
- Object.entries(filesAndHAndlers).forEach(pair => {
69
- const [file, className] = pair;
70
- const content = readFileSync(module.path + sep + 'samples' + sep + file, 'utf-8');
71
- it(`${className.name} detects ${file}`, () => {
72
- expect(() => {
73
- new className(content)
74
- }).not.toThrow(Error);
75
- });
76
-
77
- Object.entries(filesAndHAndlers).forEach(pair => {
78
- const className2 = pair[1];
79
- if (className2 === className) {
80
- return;
81
- }
82
-
83
- it(`${className2.name} rejects ${file}`, () => {
84
- expect(() => {
85
- new className2(content)
86
- }).toThrow(Error);
87
- });
88
- })
89
- });
90
-
91
-
92
- */
93
78
} ) ;
0 commit comments