File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,32 @@ describe("Statistics", () => {
104104 } ) ;
105105 } ) ;
106106
107+ context ( "options.until" , ( ) => {
108+ it ( "returns the appropriate elements" , async ( ) => {
109+ // Given
110+ const options : Options = { ...defaultOptions , until : "2010-01-01" } ;
111+ await new TestRepositoryFixture ( )
112+ . addFile ( { name : "a.js" , date : "2000-01-01T00:00:00" } )
113+ . addFile ( { name : "b.js" , date : "2020-01-01T00:00:00" } )
114+ . addFile ( { name : "c.js" , date : "2020-01-01T00:00:00" } )
115+ . writeOnDisk ( ) ;
116+
117+ // When
118+ const result = await Statistics . compute ( options ) ;
119+ const statistics = Array . from ( result . values ( ) ) ;
120+
121+ // Then
122+ expect ( statistics ) . to . deep . equal ( [
123+ {
124+ churn : 1 ,
125+ complexity : 1 ,
126+ path : "a.js" ,
127+ score : 1 ,
128+ } ,
129+ ] ) ;
130+ } ) ;
131+ } ) ;
132+
107133 context ( "options.sort=score" , ( ) => {
108134 it ( "returns the appropriate elements" , async ( ) => {
109135 // Given
You can’t perform that action at this time.
0 commit comments