Skip to content
Myr

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

lines 20–24why, one step back
20// spawn EACCES
21exec(bin + ' search', function (error, stdout, stderr) {22 // TODO error info are not the same in between <v0.10 and v0.1223 should.notEqual(0, stderr.length);24});

Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0

line 25why, one step back
25

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

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