diff --git a/packages/amplify-codegen-e2e-tests/src/gen2-codegen-tests-base/commands.ts b/packages/amplify-codegen-e2e-tests/src/gen2-codegen-tests-base/commands.ts index 0b1ba6a5f..7f0e87562 100644 --- a/packages/amplify-codegen-e2e-tests/src/gen2-codegen-tests-base/commands.ts +++ b/packages/amplify-codegen-e2e-tests/src/gen2-codegen-tests-base/commands.ts @@ -92,8 +92,15 @@ export const sandboxDeploy = async (cwd: string, props: Gen2DeployProps = {}): P }; // Run sandbox deployment + + /** + * For sandbox deployment, the nested ampx binary is retrieved instead of using npx + * On windows, the Ctrl-C signal is not returned correctly from npx binary, whose code is 1 and will fail nexpect check + * Therefore, the ampx binary is used for sandbox deployment instead of npx + */ + const ampxCli = getAmpxPath(cwd) await - spawn(getNpxPath(), ['ampx', 'sandbox'], commandOptions) + spawn(ampxCli, ['sandbox'], commandOptions) .wait('Watching for file changes...') .sendCtrlC() .runAsync();