From 881fd1c54045b767dce893ab5041550815aebe44 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Mon, 15 Apr 2024 13:56:23 +0100 Subject: [PATCH] fix fs helper git test --- __tests__/fs-helper.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__tests__/fs-helper.test.ts b/__tests__/fs-helper.test.ts index c178c9a..ec56c50 100644 --- a/__tests__/fs-helper.test.ts +++ b/__tests__/fs-helper.test.ts @@ -223,8 +223,14 @@ describe('ensureCorrectShaCheckedOut', () => { beforeEach(() => { dir = fsHelper.createTempDir(tmpFileDir, 'subdir') - // Set up a git repository with two commits + // Set up a git repository execSync('git init', { cwd: dir }) + + // Set user and email in this git repo (not globally) + execSync('git config user.email monalisa@github.com', { cwd: dir }) + execSync('git config user.name Mona', { cwd: dir }) + + // Add two commits execSync('git commit --allow-empty -m "test"', { cwd: dir }) execSync('git commit --allow-empty -m "test"', { cwd: dir })