From dceda685d5ddafded8faa0fdb14a85d3bfdd2e28 Mon Sep 17 00:00:00 2001 From: N Date: Sun, 25 Sep 2016 21:17:26 -0700 Subject: [PATCH] test(commit-msg): started test --- test/commit-msg.spec.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/commit-msg.spec.js 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, ''); + }); +});