From e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sat, 28 Jun 2025 17:26:46 -0700 Subject: initial commit: scaffolding --- .../spawn-command/test/spawn-command-test.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 node_modules/spawn-command/test/spawn-command-test.js (limited to 'node_modules/spawn-command/test/spawn-command-test.js') diff --git a/node_modules/spawn-command/test/spawn-command-test.js b/node_modules/spawn-command/test/spawn-command-test.js new file mode 100644 index 0000000..f74739a --- /dev/null +++ b/node_modules/spawn-command/test/spawn-command-test.js @@ -0,0 +1,26 @@ +var path = require('path'), + assert = require('assert'), + assertCalled = require('assert-called'), + spawnCommand = require('../'); + +var win32 = (process.platform === 'win32'), + newln = win32 ? '\r\n' : '\n', + grep = win32 ? 'findstr' : 'grep', + child = spawnCommand(grep + ' commit < ' + path.join(__dirname, 'fixtures', 'commit')), + stderr = '', + stdout = '', + exited = false; + +child.stdout.on('data', function (chunk) { + stdout += chunk; +}); + +child.stderr.on('data', function (chunk) { + stderr += chunk; +}); + +child.on('exit', assertCalled(function (exitCode) { + assert.equal(exitCode, 0); + assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c' + newln); + assert.equal(stderr, ''); +})); -- cgit v1.2.3