@@ -7,24 +7,24 @@ import { getCollectionNewestGitCommitDate } from "../index.js";
77
88const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
99
10- test ( "Get newest commit date of collection" , ( t ) => {
10+ test ( "Get newest commit date of collection" , async ( t ) => {
1111 const collection = [
1212 { inputPath : path . join ( __dirname , "./fixtures/sample.md" ) } ,
1313 { inputPath : path . join ( __dirname , "./fixtures/another-sample-file.md" ) } ,
1414 ] ;
15- const date = getCollectionNewestGitCommitDate ( collection ) ;
15+ const date = await getCollectionNewestGitCommitDate ( collection ) ;
1616 t . truthy ( date ) ;
1717 t . is ( date . toISOString ( ) , "2021-08-19T09:57:47.000Z" ) ;
1818} ) ;
1919
2020test ( "Shouldn't get commit date from an empty collection" , async ( t ) => {
2121 const collection = [ ] ;
2222
23- t . is ( getCollectionNewestGitCommitDate ( collection ) , undefined ) ;
23+ t . is ( await getCollectionNewestGitCommitDate ( collection ) , undefined ) ;
2424} ) ;
2525
2626test ( "Shouldn't get commit date from collection of uncommited files" , async ( t ) => {
27- const outputBase = path . join ( "tests/ output/") ;
27+ const outputBase = path . join ( __dirname , " output/collection ") ;
2828 const collection = [
2929 { inputPath : path . join ( outputBase , "test-01.md" ) } ,
3030 { inputPath : path . join ( outputBase , "test-02.md" ) } ,
@@ -35,7 +35,7 @@ test("Shouldn't get commit date from collection of uncommited files", async (t)
3535 await mkdir ( outputBase , { recursive : true } ) ;
3636 await Promise . all ( collection . map ( ( p ) => writeFile ( p . inputPath , "" ) ) ) ;
3737
38- t . is ( getCollectionNewestGitCommitDate ( collection ) , undefined ) ;
38+ t . is ( await getCollectionNewestGitCommitDate ( collection ) , undefined ) ;
3939
4040 await rimraf ( outputBase ) ;
4141} ) ;
0 commit comments