From 521cfe412941588cea060b7e14ef500947e3c887 Mon Sep 17 00:00:00 2001 From: Al Harris Date: Mon, 18 Sep 2023 11:32:02 -0700 Subject: [PATCH] chore: get existing e2e tests passing --- packages/amplify-codegen-e2e-core/src/categories/codegen.ts | 2 +- packages/amplify-codegen/commands/codegen/add.js | 2 +- .../amplify-codegen/src/utils/getAppSyncAPIInfoFromProject.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/amplify-codegen-e2e-core/src/categories/codegen.ts b/packages/amplify-codegen-e2e-core/src/categories/codegen.ts index 0740e90f3..39f419fde 100644 --- a/packages/amplify-codegen-e2e-core/src/categories/codegen.ts +++ b/packages/amplify-codegen-e2e-core/src/categories/codegen.ts @@ -168,7 +168,7 @@ export function generateModelIntrospection(cwd: string, settings: { outputDir?: // CLI workflow to add codegen to non-Amplify JS project export function addCodegenNonAmplifyJS(cwd: string): Promise { return new Promise((resolve, reject) => { - const cmdOptions = ['codegen', 'add', '--apiId', 'mockapiid']; + const cmdOptions = ['codegen', 'add']; const chain = spawn(getCLIPath(), cmdOptions, { cwd, stripColors: true }); chain .wait("Choose the type of app that you're building") diff --git a/packages/amplify-codegen/commands/codegen/add.js b/packages/amplify-codegen/commands/codegen/add.js index 4a7d8c348..0a64e45fd 100644 --- a/packages/amplify-codegen/commands/codegen/add.js +++ b/packages/amplify-codegen/commands/codegen/add.js @@ -10,7 +10,7 @@ module.exports = { const { options = {} } = context.parameters; const keys = Object.keys(options); // frontend and framework are undocumented, but are read when apiId is also supplied - const { apiId = null, region, yes, frontend, framework, ...rest } = options; + const { apiId = null, region, yes, frontend, framework, debug, ...rest } = options; const extraOptions = Object.keys(rest); if (extraOptions.length) { const paramMsg = extraOptions.length > 1 ? 'Invalid parameters' : 'Invalid parameter'; diff --git a/packages/amplify-codegen/src/utils/getAppSyncAPIInfoFromProject.js b/packages/amplify-codegen/src/utils/getAppSyncAPIInfoFromProject.js index e4b9ee6e3..18c1cb5c5 100644 --- a/packages/amplify-codegen/src/utils/getAppSyncAPIInfoFromProject.js +++ b/packages/amplify-codegen/src/utils/getAppSyncAPIInfoFromProject.js @@ -3,7 +3,7 @@ const getAppSyncAPIInfo = require('./getAppSyncAPIInfo'); /* Get AppSync api info if api id and region are avialable. * Otherwise return undefined. */ -function getAppSyncAPIInfoFromProject(project, context) { +function getAppSyncAPIInfoFromProject(context, project) { if (project.amplifyExtension.apiId && project.amplifyExtension.region) { const { amplifyExtension: { apiId, region },