command.executableSubcommand.default.test.js
This file
Path
tests/command.executableSubcommand.default.test.js
18 lines · 585 bytes · JavaScript
Last changed by
Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
History of this fileTake it
Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
lines 1–18why, one step back1const childProcess = require('child_process');2const path = require('path');34const bin = path.join(__dirname, './fixtures/pm');56test('when default subcommand and no command then call default', (done) => {7 childProcess.execFile(bin, [], { }, function(_error, stdout, stderr) {8 expect(stdout).toBe('default\n');9 done();10 });11});1213test('when default subcommand and unrecognised argument then call default', (done) => {14 childProcess.execFile(bin, ['unrecognised-argument'], { }, function(_error, stdout, stderr) {15 expect(stdout).toBe('default\n');16 done();17 });18});