@@ -15,6 +15,7 @@ import { Timecode } from './timecode';
1515
1616async function runTimecodesTest (
1717 rate : Rate ,
18+ dropFrame : boolean ,
1819 filename : string ,
1920 maxFrames ?: number
2021) {
@@ -34,7 +35,7 @@ async function runTimecodesTest(
3435 if ( line . trim ( ) === '' ) continue ;
3536
3637 // Frame index -> timecode string
37- const tcFromIndex = new Timecode ( frameIndex , rate , rate . drop > 0 ) ;
38+ const tcFromIndex = new Timecode ( frameIndex , rate , dropFrame ) ;
3839 expect ( tcFromIndex . toString ( ) ) . toBe ( line ) ;
3940
4041 // Timecode string -> frameIndex
@@ -54,21 +55,27 @@ async function runTimecodesTest(
5455
5556describe ( 'test all timecodes exhaustively' , ( ) => {
5657 test ( 'all timecodes - 23.976' , async ( ) => {
57- await runTimecodesTest ( Rate_23_976 , 'tc-all-23_976.txt' , 10000 ) ;
58+ await runTimecodesTest ( Rate_23_976 , false , 'tc-all-23_976.txt' , 10000 ) ;
5859 } ) ;
5960 test ( 'all timecodes - 24' , async ( ) => {
60- await runTimecodesTest ( Rate_24 , 'tc-all-24.txt' , 10000 ) ;
61+ await runTimecodesTest ( Rate_24 , false , 'tc-all-24.txt' , 10000 ) ;
6162 } ) ;
62- test ( 'all timecodes - 29.97' , async ( ) => {
63- await runTimecodesTest ( Rate_29_97 , 'tc-all-29_97.txt' , 10000 ) ;
63+ test ( 'all timecodes - 29.97 NDF' , async ( ) => {
64+ await runTimecodesTest ( Rate_29_97 , false , 'tc-all-30.txt' , 10000 ) ;
65+ } ) ;
66+ test ( 'all timecodes - 29.97 DF' , async ( ) => {
67+ await runTimecodesTest ( Rate_29_97 , true , 'tc-all-29_97.txt' , 10000 ) ;
6468 } ) ;
6569 test ( 'all timecodes - 30' , async ( ) => {
66- await runTimecodesTest ( Rate_30 , 'tc-all-30.txt' , 10000 ) ;
70+ await runTimecodesTest ( Rate_30 , false , 'tc-all-30.txt' , 10000 ) ;
71+ } ) ;
72+ test ( 'all timecodes - 59.94 NDF' , async ( ) => {
73+ await runTimecodesTest ( Rate_59_94 , false , 'tc-all-60.txt' , 10000 ) ;
6774 } ) ;
68- test ( 'all timecodes - 59.94' , async ( ) => {
69- await runTimecodesTest ( Rate_59_94 , 'tc-all-59_94.txt' , 10000 ) ;
75+ test ( 'all timecodes - 59.94 DF ' , async ( ) => {
76+ await runTimecodesTest ( Rate_59_94 , true , 'tc-all-59_94.txt' , 10000 ) ;
7077 } ) ;
7178 test ( 'all timecodes - 60' , async ( ) => {
72- await runTimecodesTest ( Rate_60 , 'tc-all-60.txt' , 10000 ) ;
79+ await runTimecodesTest ( Rate_60 , false , 'tc-all-60.txt' , 10000 ) ;
7380 } ) ;
7481} ) ;
0 commit comments