Skip to content

Commit

Permalink
rename executeChildProcessWithPackageManager to executeCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
0618 committed Jan 29, 2024
1 parent 33d05dd commit a2f0e5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions packages/backend-deployer/src/cdk_deployer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ void describe('invokeCDKCommand', () => {
backendLocator,
packageManagerControllerFactory.getPackageManagerController()
);
const execaMock = mock.method(
invoker,
'executeChildProcessWithPackageManager',
() => Promise.resolve()
const execaMock = mock.method(invoker, 'executeCommand', () =>
Promise.resolve()
);

beforeEach(() => {
Expand Down Expand Up @@ -271,7 +269,7 @@ void describe('invokeCDKCommand', () => {
});

void it('returns human readable errors', async () => {
mock.method(invoker, 'executeChildProcessWithPackageManager', () => {
mock.method(invoker, 'executeCommand', () => {
throw new Error('Access Denied');
});

Expand Down
8 changes: 4 additions & 4 deletions packages/backend-deployer/src/cdk_deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class CDKDeployer implements BackendDeployer {
* Wrapper for the child process executor. Helps in unit testing as node:test framework
* doesn't have capabilities to mock exported functions like `execa` as of right now.
*/
executeChildProcessWithPackageManager = async (
executeCommand = async (
commandArgs: string[],
options: { printStdout: boolean } = { printStdout: true }
) => {
Expand Down Expand Up @@ -131,7 +131,7 @@ export class CDKDeployer implements BackendDeployer {
return;
}
try {
await this.executeChildProcessWithPackageManager(
await this.executeCommand(
[
'tsc',
'--showConfig',
Expand All @@ -145,7 +145,7 @@ export class CDKDeployer implements BackendDeployer {
return;
}
try {
await this.executeChildProcessWithPackageManager([
await this.executeCommand([
'tsc',
'--noEmit',
'--skipLibCheck',
Expand Down Expand Up @@ -228,7 +228,7 @@ export class CDKDeployer implements BackendDeployer {
cdkCommandArgs.push(...additionalArguments);
}

return await this.executeChildProcessWithPackageManager(cdkCommandArgs);
return await this.executeCommand(cdkCommandArgs);
};

private populateCDKOutputFromStdout = async (
Expand Down

0 comments on commit a2f0e5a

Please sign in to comment.