diff --git a/test/ignore-pattern.js b/test/ignore-pattern.js index 9ad0952f..ea1811ba 100644 --- a/test/ignore-pattern.js +++ b/test/ignore-pattern.js @@ -8,7 +8,7 @@ var tapeBin = path.join(process.cwd(), 'bin/tape'); tap.test('should allow ignore file together with --ignore-pattern', function (tt) { tt.plan(1); - var proc = execFile(tapeBin, ['--ignore', '.ignore', '--ignore-pattern', 'fake_other_ignored_dir', '**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); + var proc = execFile(process.execPath, [tapeBin, '--ignore', '.ignore', '--ignore-pattern', 'fake_other_ignored_dir', '**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); proc.on('exit', function (code) { tt.equals(code, 0); @@ -17,7 +17,7 @@ tap.test('should allow ignore file together with --ignore-pattern', function (tt tap.test('should allow --ignore-pattern without ignore file', function (tt) { tt.plan(1); - var proc = execFile(tapeBin, ['--ignore-pattern', 'fake_*', '**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); + var proc = execFile(process.execPath, [tapeBin, '--ignore-pattern', 'fake_*', '**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); proc.on('exit', function (code) { tt.equals(code, 0); @@ -26,7 +26,7 @@ tap.test('should allow --ignore-pattern without ignore file', function (tt) { tap.test('should fail if not ignoring', function (tt) { tt.plan(1); - var proc = execFile(tapeBin, ['**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); + var proc = execFile(process.execPath, [tapeBin, '**/*.js'], { cwd: path.join(__dirname, 'ignore-pattern') }); proc.on('exit', function (code) { tt.equals(code, 1); diff --git a/test/ignore_from_gitignore.js b/test/ignore_from_gitignore.js index 3e46cdc5..b00af153 100644 --- a/test/ignore_from_gitignore.js +++ b/test/ignore_from_gitignore.js @@ -9,7 +9,7 @@ var stripFullStack = require('./common').stripFullStack; var tapeBin = path.join(process.cwd(), 'bin/tape'); -tap.test('Should pass with ignoring', { skip: process.platform === 'win32' }, function (tt) { +tap.test('Should pass with ignoring', function (tt) { tt.plan(2); var tc = function (rows) { @@ -38,14 +38,14 @@ tap.test('Should pass with ignoring', { skip: process.platform === 'win32' }, fu ]); }; - var ps = spawn(tapeBin, ['**/*.js', '-i', '.ignore'], { cwd: path.join(__dirname, 'ignore') }); + var ps = spawn(process.execPath, [tapeBin, '**/*.js', '-i', '.ignore'], { cwd: path.join(__dirname, 'ignore') }); ps.stdout.pipe(concat(tc)); ps.on('exit', function (code) { tt.equal(code, 0); // code 0 }); }); -tap.test('Should pass', { skip: process.platform === 'win32' }, function (tt) { +tap.test('Should pass', function (tt) { tt.plan(2); var tc = function (rows) { @@ -95,14 +95,14 @@ tap.test('Should pass', { skip: process.platform === 'win32' }, function (tt) { ]); }; - var ps = spawn(tapeBin, ['**/*.js'], { cwd: path.join(__dirname, 'ignore') }); + var ps = spawn(process.execPath, [tapeBin, '**/*.js'], { cwd: path.join(__dirname, 'ignore') }); ps.stdout.pipe(concat(tc)); ps.on('exit', function (code) { tt.equal(code, 1); }); }); -tap.test('Should fail when ignore file does not exist', { skip: process.platform === 'win32' }, function (tt) { +tap.test('Should fail when ignore file does not exist', function (tt) { tt.plan(3); var testStdout = function (rows) { @@ -113,7 +113,7 @@ tap.test('Should fail when ignore file does not exist', { skip: process.platform tt.ok((/^ENOENT[:,] no such file or directory,? (?:open )?'\$TEST\/ignore\/.gitignore'\n$/m).test(stripFullStack(rows.toString('utf8')).join('\n'))); }; - var ps = spawn(tapeBin, ['**/*.js', '-i'], { cwd: path.join(__dirname, 'ignore') }); + var ps = spawn(process.execPath, [tapeBin, '**/*.js', '-i'], { cwd: path.join(__dirname, 'ignore') }); ps.stdout.pipe(concat(testStdout)); ps.stderr.pipe(concat(testStderr)); ps.on('exit', function (code) { diff --git a/test/import.js b/test/import.js index 4f8a13ea..c86ed41c 100644 --- a/test/import.js +++ b/test/import.js @@ -9,7 +9,7 @@ var assign = require('object.assign'); function tape(args, options) { var bin = __dirname + '/../bin/tape'; - return spawn(process.argv[0], [bin].concat(args.split(' ')), assign({ cwd: __dirname }, options)); + return spawn(process.execPath, [bin].concat(args.split(' ')), assign({ cwd: __dirname }, options)); } tap.test('importing mjs files', function (t) { diff --git a/test/require.js b/test/require.js index 70334153..c6a93164 100644 --- a/test/require.js +++ b/test/require.js @@ -8,7 +8,7 @@ var stripFullStack = require('./common').stripFullStack; function tape(args) { var bin = __dirname + '/../bin/tape'; - return spawn('node', [bin].concat(args.split(' ')), { cwd: __dirname }); + return spawn(process.execPath, [bin].concat(args.split(' ')), { cwd: __dirname }); } tap.test('requiring a single module', function (t) {