diff --git a/test/commit-msg.spec.js b/test/commit-msg.spec.js new file mode 100644 index 0000000..f183e38 --- /dev/null +++ b/test/commit-msg.spec.js @@ -0,0 +1,32 @@ +var assert = require('assert'); +var exec = require('child_process').execSync; + +var utils = require('./_utils.js'); +var SAMPLE_REPO_LOCATION = utils.SAMPLE_REPO_LOCATION; + +describe('commit-msg', function () { + before(function () { + utils.setup({ + 'githook:commit-msg': 'node -e "console.log(process.argv);"' + }); + }); + after(utils.teardown); + + it('should ', function () { + var commitResult; + + exec( + 'git add sample-file.txt', + { cwd: SAMPLE_REPO_LOCATION } + ); + + commitResult = exec( + 'git commit -m "testing commit-msg"', + { cwd: SAMPLE_REPO_LOCATION } + ) + .toString() + .trim(); + + assert.equal(commitResult, ''); + }); +});