Skip to content
Myr

test.command.executableSubcommandDefault.js

This file

Path

test/test.command.executableSubcommandDefault.js

53 lines · 1.5 KiB · JavaScript

Last changed by

Merge pull request #935 from MarshallOfSound/fix-deep-sym-link-resolutionTomoaki Abebefore adoption50922d8

History of this file

Take it

Merge pull request #415 from Qix-/default-subcommandRandall Koutnikbefore adoption0af40a5

lines 1–46why, one step back
1var exec = require('child_process').exec
2 , path = require('path')3 , should = require('should');4567var bin = path.join(__dirname, './fixtures/pm')8// success case9exec(bin + ' default', function(error, stdout, stderr) {10 stdout.should.equal('default\n');11});1213// success case (default)14exec(bin, function(error, stdout, stderr) {15 stdout.should.equal('default\n');16});1718// not exist19exec(bin + ' list', function (error, stdout, stderr) {20 //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n');21 // TODO error info are not the same in between <=v0.8 and later version22 should.notEqual(0, stderr.length);23});2425// success case26exec(bin + ' install', function (error, stdout, stderr) {27 stdout.should.equal('install\n');28});2930// subcommand bin file with explicit extension31exec(bin + ' publish', function (error, stdout, stderr) {32 stdout.should.equal('publish\n');33});3435// spawn EACCES36exec(bin + ' search', function (error, stdout, stderr) {37 // TODO error info are not the same in between <v0.10 and v0.1238 should.notEqual(0, stderr.length);39});4041// when `bin` is a symbol link for mocking global install42var bin = path.join(__dirname, './fixtures/pmlink')43// success case44exec(bin + ' install', function (error, stdout, stderr) {45 stdout.should.equal('install\n');46});

Merge pull request #935 from MarshallOfSound/fix-deep-sym-link-resolutionTomoaki Abebefore adoption50922d8

lines 47–53why, one step back
47
48// when `bin` is a symbol link pointing at a symbolic for mocking global install49var bin = path.join(__dirname, './fixtures/another-dir/pm')50// success case51exec(bin + ' install', function (error, stdout, stderr) {52 stdout.should.equal('install\n');53});