diff --git a/spec/task-helpers/git_helper_spec.js b/spec/task-helpers/git_helper.spec.js similarity index 86% rename from spec/task-helpers/git_helper_spec.js rename to spec/task-helpers/git_helper.spec.js index abd0ee82e..e7aea0391 100644 --- a/spec/task-helpers/git_helper_spec.js +++ b/spec/task-helpers/git_helper.spec.js @@ -1,17 +1,16 @@ -import Git_helper from '../../tasks/helpers/git_helper'; -import MockPromises from 'mock-promises'; +import GitHelper from '../../tasks/helpers/git_helper'; describe('GitHelper', () => { let gitHelper; beforeEach(() => { - gitHelper = new Git_helper(); + gitHelper = new GitHelper(); }); describe('#getLatestCommit', () => { describe('when the tag does not exist', () => { describe('when the major version branch exists', () => { - beforeEach(async(done) => { + beforeEach(async () => { spyOn(gitHelper, 'git').and.callFake(command => { if (command === 'branch') { return Promise.resolve(' v8\n v9\n* v10\n master'); @@ -20,7 +19,6 @@ describe('GitHelper', () => { } }); await gitHelper.getLatestCommit('10.0.0'); - done(); }); it('gets the latest commit on that branch', () => { @@ -30,7 +28,7 @@ describe('GitHelper', () => { }); describe('when the major version branch does not exists', () => { - beforeEach(async(done) => { + beforeEach(async () => { spyOn(gitHelper, 'git').and.callFake(command => { if (command === 'branch') { return Promise.resolve(' v8\n v9\n* master'); @@ -39,7 +37,6 @@ describe('GitHelper', () => { } }); await gitHelper.getLatestCommit('10.0.0'); - done(); }); it('gets the latest commit on master', () => { @@ -50,15 +47,12 @@ describe('GitHelper', () => { }); describe('when the tag does exist', () => { - beforeEach(async(done) => { + beforeEach(async () => { spyOn(gitHelper, 'git').and.returnValue(Promise.resolve('')); await gitHelper.getLatestCommit('10.0.0'); - done(); }); it('returns the commit of that tag', () => { - MockPromises.tick(100); - expect(gitHelper.git).toHaveBeenCalledWith('rev-parse 10.0.0'); expect(gitHelper.git).not.toHaveBeenCalledWith('log master -1 --oneline --format=format:%H'); });