test.command.executableSubcommand.js
This file
Path
test/test.command.executableSubcommand.js
31 lines · 929 bytes · JavaScript
Last changed by
Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
History of this fileTake it
1234567891011121314151617181920212223242526272829303132var exec = require('child_process').exec , path = require('path') , should = require('should');
var bin = path.join(__dirname, './fixtures/pm')// not existexec(bin + ' list', function (error, stdout, stderr) { //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n'); // TODO error info are not the same in between <=v0.8 and later version should.notEqual(0, stderr.length);});
// success caseexec(bin + ' install', function (error, stdout, stderr) { stdout.should.equal('install\n');});
// spawn EACCESexec(bin + ' search', function (error, stdout, stderr) { // TODO error info are not the same in between <v0.10 and v0.12 should.notEqual(0, stderr.length);});
// when `bin` is a symbol link for mocking global installvar bin = path.join(__dirname, './fixtures/pmlink')// success caseexec(bin + ' install', function (error, stdout, stderr) { stdout.should.equal('install\n');});