From 2597d0e06e0a0514236ca2e3c96f875055e614f8 Mon Sep 17 00:00:00 2001 From: "Robert (Jamie) Munro" Date: Tue, 1 May 2018 18:14:05 +0100 Subject: [PATCH] Fix tests for node 0.10 which has no execSync --- tests/uninstall.test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/uninstall.test.js b/tests/uninstall.test.js index 5856ba7..56fa421 100644 --- a/tests/uninstall.test.js +++ b/tests/uninstall.test.js @@ -1,5 +1,5 @@ require('chai').should(); -var execSync = require('child_process').execSync; +var exec = require('child_process').exec; var gitHooks = require('../lib/git-hooks'); var fsHelpers = require('../lib/fs-helpers'); @@ -9,9 +9,14 @@ var GIT_HOOKS = GIT_ROOT + 'hooks'; var GIT_HOOKS_OLD = GIT_ROOT + 'hooks.old'; describe('--uninstall', function () { - beforeEach(function () { + beforeEach(function (done) { fsHelpers.makeDir(SANDBOX_PATH); - execSync('git init', {cwd: SANDBOX_PATH}); + exec('git init', {cwd: SANDBOX_PATH}, function (err) { + if (err) { + throw err; + } + done(); + }); }); afterEach(function () {