Skip to content
Myr

test.command.executableSubcommandAlias.js

This file

Path

test/test.command.executableSubcommandAlias.js

35 lines · 1.0 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 branch 'pr/545'zhiyeleebefore adoptionc6236d9

lines 1–28why, one step back
1var exec = require('child_process').exec
2 , path = require('path')3 , should = require('should');45var bin = path.join(__dirname, './fixtures/pm')67// success case8exec(bin + ' i', function (error, stdout, stderr) {9 stdout.should.equal('install\n');10});1112// subcommand bin file with explicit extension13exec(bin + ' p', function (error, stdout, stderr) {14 stdout.should.equal('publish\n');15});1617// spawn EACCES18exec(bin + ' s', function (error, stdout, stderr) {19 // error info are not the same in between <v0.10 and v0.1220 should.notEqual(0, stderr.length);21});2223// when `bin` is a symbol link for mocking global install24var bin = path.join(__dirname, './fixtures/pmlink')25// success case26exec(bin + ' i', function (error, stdout, stderr) {27 stdout.should.equal('install\n');28});

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

lines 29–35why, one step back
29
30// when `bin` is a symbol link pointing at a symbolic for mocking global install31var bin = path.join(__dirname, './fixtures/another-dir/pm')32// success case33exec(bin + ' install', function (error, stdout, stderr) {34 stdout.should.equal('install\n');35});