Skip to content

Commit 7004bdd

Browse files
committed
Add test case for git repo not having a hooks folder
1 parent e1633a5 commit 7004bdd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/install.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ describe('--install', function () {
2626
fsHelpers.exists(GIT_HOOKS).should.be.true;
2727
});
2828

29+
describe('when git repo is missing its hooks folder', function () {
30+
beforeEach(function () {
31+
fsHelpers.removeDir(GIT_ROOT + '/hooks');
32+
});
33+
34+
it('should install hooks', function () {
35+
gitHooks.install(SANDBOX_PATH);
36+
fsHelpers.exists(GIT_HOOKS).should.be.true;
37+
});
38+
});
39+
2940
describe('when it is run not inside a git repo', function () {
3041
beforeEach(function () {
3142
fsHelpers.removeDir(GIT_ROOT);

0 commit comments

Comments
 (0)