diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/packages/npm-test-array-bin/bin/array-bin | 2 | ||||
-rw-r--r-- | test/packages/npm-test-array-bin/package.json | 4 | ||||
-rw-r--r-- | test/packages/npm-test-array-bin/test.js | 6 | ||||
-rw-r--r-- | test/packages/npm-test-dir-bin/bin/dir-bin | 2 | ||||
-rw-r--r-- | test/packages/npm-test-dir-bin/package.json | 4 | ||||
-rw-r--r-- | test/packages/npm-test-dir-bin/test.js | 5 |
6 files changed, 23 insertions, 0 deletions
diff --git a/test/packages/npm-test-array-bin/bin/array-bin b/test/packages/npm-test-array-bin/bin/array-bin new file mode 100644 index 000000000..9558516aa --- /dev/null +++ b/test/packages/npm-test-array-bin/bin/array-bin @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log('ok') diff --git a/test/packages/npm-test-array-bin/package.json b/test/packages/npm-test-array-bin/package.json new file mode 100644 index 000000000..45e22efc4 --- /dev/null +++ b/test/packages/npm-test-array-bin/package.json @@ -0,0 +1,4 @@ +{ "name":"npm-test-array-bin" +, "version":"1.2.5" +, "bin": [ "bin/array-bin" ] +, "scripts": { "test": "node test.js" } } diff --git a/test/packages/npm-test-array-bin/test.js b/test/packages/npm-test-array-bin/test.js new file mode 100644 index 000000000..b779e3a22 --- /dev/null +++ b/test/packages/npm-test-array-bin/test.js @@ -0,0 +1,6 @@ +var c = require('child_process').spawn('array-bin', [], { + env: process.env }).on('close', function (code) { + if (code) throw new Error('exited badly with code = ' + code) +}) +c.stdout.pipe(process.stdout) +c.stderr.pipe(process.stderr) diff --git a/test/packages/npm-test-dir-bin/bin/dir-bin b/test/packages/npm-test-dir-bin/bin/dir-bin new file mode 100644 index 000000000..9558516aa --- /dev/null +++ b/test/packages/npm-test-dir-bin/bin/dir-bin @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log('ok') diff --git a/test/packages/npm-test-dir-bin/package.json b/test/packages/npm-test-dir-bin/package.json new file mode 100644 index 000000000..1ea26323f --- /dev/null +++ b/test/packages/npm-test-dir-bin/package.json @@ -0,0 +1,4 @@ +{ "name":"npm-test-dir-bin" +, "version":"1.2.5" +, "directories": { "bin": "./bin" } +, "scripts": { "test": "node test.js" } } diff --git a/test/packages/npm-test-dir-bin/test.js b/test/packages/npm-test-dir-bin/test.js new file mode 100644 index 000000000..e4ee83f9e --- /dev/null +++ b/test/packages/npm-test-dir-bin/test.js @@ -0,0 +1,5 @@ +require('child_process').spawn('dir-bin', [], { + env: process.env }).on('exit', function (code) { + if (code) throw new Error('exited badly with code = ' + code) +}) + |