From e3db6d5f02c8d769cd572609f3b4d7cadbbdf955 Mon Sep 17 00:00:00 2001 From: Ammar <56042290+ammarkarachi@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:07:45 -0800 Subject: [PATCH] Fix/export pull e2e 2 (#8785) * test(amplify-e2e-tests): adding a setting * test(amplify-e2e-core): testlambda with latest codebase --- packages/amplify-e2e-core/src/categories/auth.ts | 2 +- packages/amplify-e2e-tests/src/__tests__/api_2.test.ts | 9 +-------- packages/amplify-e2e-tests/src/__tests__/api_5.test.ts | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/amplify-e2e-core/src/categories/auth.ts b/packages/amplify-e2e-core/src/categories/auth.ts index d450f16a828..c5db56ba583 100644 --- a/packages/amplify-e2e-core/src/categories/auth.ts +++ b/packages/amplify-e2e-core/src/categories/auth.ts @@ -1268,7 +1268,7 @@ export function updateAuthAddUserGroups(projectDir: string, groupNames: string[] if (groupNames.length == 0) { return; } - const testingWithLatestCodebase = settings.testingWithLatestCodebase ?? false; + const testingWithLatestCodebase = settings && settings.testingWithLatestCodebase ? settings.testingWithLatestCodebase : false; return new Promise((resolve, reject) => { const chain = spawn(getCLIPath(testingWithLatestCodebase), ['update', 'auth'], { cwd: projectDir, stripColors: true }); if (settings?.overrides?.category === 'auth') { diff --git a/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts b/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts index 2b1e2fe0b66..42303ef3585 100644 --- a/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/api_2.test.ts @@ -1,14 +1,10 @@ import { addApiWithBlankSchemaAndConflictDetection, addApiWithoutSchema, - addFunction, - addRestApi, - addSimpleDDB, amplifyPush, amplifyPushUpdate, apiDisableDataStore, apiEnableDataStore, - checkIfBucketExists, createNewProjectDir, deleteProject, deleteProjectDir, @@ -18,14 +14,11 @@ import { getProjectMeta, getTransformConfig, initJSProjectWithProfile, - listAttachedRolePolicies, - listRolePolicies, updateApiSchema, updateAPIWithResolutionStrategyWithModels, - updateAuthAddAdminQueries, } from 'amplify-e2e-core'; import AWSAppSyncClient, { AUTH_TYPE } from 'aws-appsync'; -import { existsSync, readdirSync, readFileSync, writeFileSync } from 'fs'; +import { existsSync } from 'fs'; import gql from 'graphql-tag'; import { TRANSFORM_CURRENT_VERSION } from 'graphql-transformer-core'; import _ from 'lodash'; diff --git a/packages/amplify-e2e-tests/src/__tests__/api_5.test.ts b/packages/amplify-e2e-tests/src/__tests__/api_5.test.ts index e190158ae02..3538cbae33a 100644 --- a/packages/amplify-e2e-tests/src/__tests__/api_5.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/api_5.test.ts @@ -120,7 +120,7 @@ describe('amplify add api (REST)', () => { allowGuestUsers: false, }); await addRestApi(projRoot, { isFirstRestApi: false, existingLambda: true }); - await updateAuthAddAdminQueries(projRoot); + await updateAuthAddAdminQueries(projRoot, undefined, {}); await amplifyPushUpdate(projRoot); const amplifyMeta = getProjectMeta(projRoot);