chore: fix test

This commit is contained in:
Cheng Liu 2024-10-21 20:04:18 -07:00
parent a9a124050b
commit f55b682f19
No known key found for this signature in database
GPG key ID: BDD2FDCF5AC296BA
2 changed files with 5 additions and 2 deletions

View file

@ -20,6 +20,7 @@ export async function runAsync(runScriptOptions: IRunScriptOptions): Promise<voi
} = runScriptOptions;
const temporaryDirectory: string = path.resolve(buildFolderPath, 'temp');
logger.terminal.writeLine(`Temporary directory: ${temporaryDirectory}`);
const testRepoURL: string = 'https://github.com/tiktok/sparo.git';
const testBranch: string = 'test-artifacts/sparo-real-repo-test';
const repoFolder: string = path.resolve(temporaryDirectory, 'sparo');

View file

@ -285,10 +285,12 @@ function replaceVersionString(text: string): string {
return text.replace(/\d+\.\d+\.\d+/g, '__VERSION__');
}
/**
* Replace all "in xx.yy seconds" strings with "in __DURATION__ seconds".
* Replace all "in xx.yy seconds" or "in x minute y.z seconds" strings with "in __DURATION__".
*/
function replaceDurationString(text: string): string {
return text.replace(/in \d+(\.\d+)? seconds/g, 'in __DURATION__');
return text
.replace(/in \d+(\.\d+)? seconds/g, 'in __DURATION__')
.replace(/in \d+ minutes? \d+(\.\d+)? seconds/g, 'in __DURATION__');
}
/**
* Replace all "<workingDirectory>" strings with "__WORKING_DIRECTORY__".