test.command.executableSubcommand.js
This file
Path
test/test.command.executableSubcommand.js
36 lines · 1.0 KiB · JavaScript
Last changed by
Merge pull request #387 from zhiyelee/bugfix_subcommandZhiye Libefore adoptiondae7802
History of this fileTake it
Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 1–2why, one step back1var exec = require('child_process').exec2 , path = require('path')Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
lines 3–4why, one step back3 , should = require('should');4Merge pull request #332 from zhiyelee/fixexitZhiye Libefore adoption29b4ea9
line 5why, one step back5Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 6why, one step back6Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 7–13why, one step back7var bin = path.join(__dirname, './fixtures/pm')8// not exist9exec(bin + ' list', function (error, stdout, stderr) {10 //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n');11 // TODO error info are not the same in between <=v0.8 and later version12 should.notEqual(0, stderr.length);13});Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 14why, one step back14Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 15–17why, one step back15// success case16exec(bin + ' install', function (error, stdout, stderr) {17 stdout.should.equal('install\n');Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
lines 18–19why, one step back18});19Merge pull request #387 from zhiyelee/bugfix_subcommandZhiye Libefore adoptiondae7802
lines 20–24why, one step back20// subcommand bin file with explicit extension21exec(bin + ' publish', function (error, stdout, stderr) {22 stdout.should.equal('publish\n');23});24Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 25–29why, one step back25// spawn EACCES26exec(bin + ' search', function (error, stdout, stderr) {27 // TODO error info are not the same in between <v0.10 and v0.1228 should.notEqual(0, stderr.length);29});Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 30why, one step back30Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 31–36why, one step back31// when `bin` is a symbol link for mocking global install32var bin = path.join(__dirname, './fixtures/pmlink')33// success case34exec(bin + ' install', function (error, stdout, stderr) {35 stdout.should.equal('install\n');36});