test: add tests for gitUtils (#6949)

* test: add tests for gitUtils

* debug test

* try fix
This commit is contained in:
Joshua Chen 2022-03-21 18:40:20 +08:00 committed by GitHub
parent 3c7b39b739
commit 5ee7e8c48e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 194 additions and 19 deletions

View file

@ -12,14 +12,12 @@ import {
GitNotFoundError,
} from '@docusaurus/utils';
type FileLastUpdateData = {timestamp?: number; author?: string};
let showedGitRequirementError = false;
let showedFileNotTrackedError = false;
export async function getFileLastUpdate(
filePath?: string,
): Promise<FileLastUpdateData | null> {
): Promise<{timestamp: number; author: string} | null> {
if (!filePath) {
return null;
}