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
12345678910111213141516171819const childProcess = require('child_process');const path = require('path');
const bin = path.join(__dirname, './fixtures/pm');
test('when default subcommand and no command then call default', (done) => { childProcess.execFile(bin, [], { }, function(_error, stdout, stderr) { expect(stdout).toBe('default\n'); done(); });});
test('when default subcommand and unrecognised argument then call default', (done) => { childProcess.execFile(bin, ['unrecognised-argument'], { }, function(_error, stdout, stderr) { expect(stdout).toBe('default\n'); done(); });});