Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit d5cb05f

Browse files
committed
Merge pull request #5 from codacy/fix-commit-tests
Fix tests (thanks @DavidTPate)
2 parents a8a3495 + 7640a90 commit d5cb05f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/getGitData.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@
5050
});
5151
it('should be able to get the commit id from Git', function () {
5252
// If we are currently running on Travis, we should be able to use the commit id environment variable
53-
// to check the git commit id method with actual git.
54-
if (actualTravisCommit) {
53+
// to check the git commit id method with actual git. But we can't do this for Pull Requests because
54+
// Travis provides the Commit id that triggered the Pull Request not the current Commit Id
55+
if (actualTravisCommit && process.env.TRAVIS_PULL_REQUEST === 'false') {
5556
return expect(getGitData.getCommitId()).to.eventually.equal(actualTravisCommit);
5657
}
5758
return expect(getGitData.getCommitId()).to.eventually.be.fulfilled;
5859
});
5960
});
60-
}(require('joi'), require('chai'), require('q'), require('util'), require('../lib/getGitData')));
61+
}(require('joi'), require('chai'), require('q'), require('util'), require('../lib/getGitData')));

0 commit comments

Comments
 (0)