Skip to content
Myr

test.command.executableSubcommand.js

This file

Path

test/test.command.executableSubcommand.js

43 lines · 1.3 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 #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4

lines 1–2why, one step back
1var exec = require('child_process').exec
2 , path = require('path')

Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0

lines 3–4why, one step back
3 , should = require('should');
4

Merge pull request #332 from zhiyelee/fixexitZhiye Libefore adoption29b4ea9

line 5why, one step back
5

Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0

line 6why, one step back
6

Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4

lines 7–13why, one step back
7var 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 back
14

Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4

lines 15–17why, one step back
15// success case
16exec(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 back
18});
19

Merge pull request #387 from zhiyelee/bugfix_subcommandZhiye Libefore adoptiondae7802

lines 20–24why, one step back
20// subcommand bin file with explicit extension
21exec(bin + ' publish', function (error, stdout, stderr) {22 stdout.should.equal('publish\n');23});24

Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4

lines 25–29why, one step back
25// spawn EACCES
26exec(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 back
30

Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4

lines 31–36why, one step back
31// when `bin` is a symbol link for mocking global install
32var bin = path.join(__dirname, './fixtures/pmlink')33// success case34exec(bin + ' install', function (error, stdout, stderr) {35 stdout.should.equal('install\n');36});

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

lines 37–43why, one step back
37
38// when `bin` is a symbol link pointing at a symbolic for mocking global install39var bin = path.join(__dirname, './fixtures/another-dir/pm')40// success case41exec(bin + ' install', function (error, stdout, stderr) {42 stdout.should.equal('install\n');43});