Skip to content

Commit

Permalink
Update method name
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Dec 6, 2024
1 parent e47c492 commit 709168c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/command.executableSubcommand.mock.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test('when subcommand executable fails with other error and exitOverride then re
return mockProcess;
});
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.exitOverride((err) => {
throw err;
});
Expand All @@ -93,7 +93,7 @@ test('when subcommand executable fails with other error then exit', () => {
});
const exitSpy = jest.spyOn(process, 'exit').mockImplementation(() => {});
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.command('executable', 'executable description');
program.parse(['executable'], { from: 'user' });
mockProcess.emit('error', makeSystemError('OTHER'));
Expand Down
8 changes: 4 additions & 4 deletions tests/command.executableSubcommand.search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('search for subcommand', () => {

test('when no script arg or executableDir then no search for local file', () => {
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.name('pm');
program.command('sub', 'executable description');
program.parse(['sub'], { from: 'user' });
Expand All @@ -68,7 +68,7 @@ describe('search for subcommand', () => {

test('when script arg then search for local files', () => {
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.name('pm');
program.command('sub', 'executable description');
program.parse(['node', 'script-name', 'sub']);
Expand All @@ -78,7 +78,7 @@ describe('search for subcommand', () => {

test('when executableDir then search for local files)', () => {
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.name('pm');
program.executableDir(__dirname);
program.command('sub', 'executable description');
Expand Down Expand Up @@ -305,7 +305,7 @@ describe('search for subcommand', () => {
test('when script arg then search for local script-sub.js, .ts, .tsx, .mpjs, .cjs', () => {
existsSpy.mockImplementation((path) => false);
const program = new commander.Command();
program._throwForMissingExecutable = () => {}; // suppress error, call mocked spawn
program._checkForMissingExecutable = () => {}; // suppress error, call mocked spawn
program.command('sub', 'executable description');
const scriptPath = path.resolve(gLocalDirectory, 'script');
program.parse(['node', scriptPath, 'sub']);
Expand Down

0 comments on commit 709168c

Please sign in to comment.