From 4b0eb18a65ed9f2d323495bfb32dd66e80755d94 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sun, 30 Aug 2020 08:58:45 +0200 Subject: [PATCH] test: refactor getBranchCommit test --- lib/util/git/index.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index 4e31c3a315..1f2d16d3f6 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -50,6 +50,8 @@ describe('platform/git', () => { await repo.addConfig('user.email', 'custom@example.com'); await repo.commit('custom message'); + await repo.checkoutBranch('renovate/equal_branch', 'master'); + await repo.checkout('master'); }); @@ -158,8 +160,8 @@ describe('platform/git', () => { describe('getBranchCommit(branchName)', () => { it('should return same value for equal refs', async () => { - const hex = await git.getBranchCommit('renovate/past_branch'); - expect(hex).toBe(await git.getBranchCommit('master~1')); + const hex = await git.getBranchCommit('renovate/equal_branch'); + expect(hex).toBe(await git.getBranchCommit('master')); expect(hex).toHaveLength(40); }); it('should throw if branch does not exist', async () => { -- GitLab