diff --git a/packages/amplify-e2e-core/src/utils/overrides.ts b/packages/amplify-e2e-core/src/utils/overrides.ts index 7e9f19fa115..1afe720a9dd 100644 --- a/packages/amplify-e2e-core/src/utils/overrides.ts +++ b/packages/amplify-e2e-core/src/utils/overrides.ts @@ -1,6 +1,6 @@ import * as fs from 'fs-extra'; -export const replaceOverrideFileWitProjectInfo = (srcPath: string, destPath: string, envName: string, projectName: string) => { +export const replaceOverrideFileWithProjectInfo = (srcPath: string, destPath: string, envName: string, projectName: string) => { const content = fs.readFileSync(srcPath).toString(); const contentWithProjectInfo = content.replace('##EXPECTED_ENV_NAME', envName).replace('##EXPECTED_PROJECT_NAME', projectName); fs.writeFileSync(destPath, contentWithProjectInfo); diff --git a/packages/amplify-e2e-tests/src/__tests__/auth_6.test.ts b/packages/amplify-e2e-tests/src/__tests__/auth_6.test.ts index f1896cad550..6c939ede574 100644 --- a/packages/amplify-e2e-tests/src/__tests__/auth_6.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/auth_6.test.ts @@ -11,7 +11,7 @@ import { getProjectMeta, getUserPool, initJSProjectWithProfile, - replaceOverrideFileWitProjectInfo, + replaceOverrideFileWithProjectInfo, runAmplifyAuthConsole, } from '@aws-amplify/amplify-e2e-core'; import * as path from 'path'; @@ -102,7 +102,7 @@ describe('zero config auth', () => { // test happy path const srcOverrideFilePath = path.join(__dirname, '..', '..', 'overrides', 'override-auth.ts'); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', PROJECT_NAME); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', PROJECT_NAME); await amplifyPushOverride(projRoot); // check overwritten config diff --git a/packages/amplify-e2e-tests/src/__tests__/init_e.test.ts b/packages/amplify-e2e-tests/src/__tests__/init_e.test.ts index 5f39d43f816..b6b04d7d722 100644 --- a/packages/amplify-e2e-tests/src/__tests__/init_e.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/init_e.test.ts @@ -11,7 +11,7 @@ import { createNewProjectDir, deleteProjectDir, getProjectMeta, - replaceOverrideFileWitProjectInfo, + replaceOverrideFileWithProjectInfo, } from '@aws-amplify/amplify-e2e-core'; import { addEnvironment } from '../environment/env'; @@ -56,13 +56,13 @@ describe('amplify init e', () => { // test happy path const srcOverrideFilePath = path.join(__dirname, '..', '..', 'overrides', 'override-root.ts'); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); await amplifyPushOverride(projRoot); const newEnvMeta = getProjectMeta(projRoot).providers.awscloudformation; expect(newEnvMeta.AuthRoleName).toContain('mockRole'); // create a new env, and the override should remain in place - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'envb', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'envb', projectName); await addEnvironment(projRoot, { envName: 'envb' }); const newestEnvMeta = getProjectMeta(projRoot).providers.awscloudformation; expect(newestEnvMeta.AuthRoleName).toContain('mockRole'); diff --git a/packages/amplify-e2e-tests/src/__tests__/storage-5.test.ts b/packages/amplify-e2e-tests/src/__tests__/storage-5.test.ts index cd4c1600e50..5c020c7b2a8 100644 --- a/packages/amplify-e2e-tests/src/__tests__/storage-5.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/storage-5.test.ts @@ -16,7 +16,7 @@ import { initJSProjectWithProfile, overrideDDB, overrideS3, - replaceOverrideFileWitProjectInfo, + replaceOverrideFileWithProjectInfo, updateDDBWithTrigger, updateSimpleDDBwithGSI, } from '@aws-amplify/amplify-e2e-core'; @@ -70,7 +70,7 @@ describe('s3 override tests', () => { // test happy path const srcOverrideFilePath = path.join(__dirname, '..', '..', 'overrides', 'override-storage-s3.ts'); const cfnFilePath = path.join(projRoot, 'amplify', 'backend', 'storage', resourceName, 'build', 'cloudformation-template.json'); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); await buildOverrideStorage(projRoot); let s3CFNFileJSON = JSONUtilities.readJson<$TSObject>(cfnFilePath); // check if overrides are applied to the cfn file @@ -207,7 +207,7 @@ describe('ddb override tests', () => { `${resourceName}-cloudformation-template.json`, ); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); await buildOverrideStorage(projRoot); let ddbCFNFileJSON = JSONUtilities.readJson<$TSObject>(cfnFilePath); // check if overrides are applied to the cfn file diff --git a/packages/amplify-migration-tests/src/__tests__/migration_tests/overrides/init-migration.test.ts b/packages/amplify-migration-tests/src/__tests__/migration_tests/overrides/init-migration.test.ts index f717f64ba57..99453746e2b 100644 --- a/packages/amplify-migration-tests/src/__tests__/migration_tests/overrides/init-migration.test.ts +++ b/packages/amplify-migration-tests/src/__tests__/migration_tests/overrides/init-migration.test.ts @@ -6,7 +6,7 @@ import { deleteProjectDir, getProjectMeta, amplifyPushOverride, - replaceOverrideFileWitProjectInfo, + replaceOverrideFileWithProjectInfo, } from '@aws-amplify/amplify-e2e-core'; import { JSONUtilities } from 'amplify-cli-core'; import { versionCheck, allowedVersionsToMigrateFrom, initJSProjectWithProfileV4_52_0 } from '../../../migration-helpers'; @@ -43,7 +43,7 @@ describe('amplify init', () => { await amplifyOverrideRoot(projRoot, { testingWithLatestCodebase: true }); const srcOverrideFilePath = path.join(__dirname, '..', '..', '..', '..', '..', 'amplify-e2e-tests', 'overrides', 'override-root.ts'); const destOverrideFilePath = path.join(projRoot, 'amplify', 'backend', 'awscloudformation', 'override.ts'); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); await amplifyPushOverride(projRoot, true); const newEnvMeta = getProjectMeta(projRoot).providers.awscloudformation; expect(newEnvMeta.AuthRoleName).toContain('mockRole'); diff --git a/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/auth-override.migration.test.ts b/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/auth-override.migration.test.ts index a0290a7ec7f..73ce34a5d93 100644 --- a/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/auth-override.migration.test.ts +++ b/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/auth-override.migration.test.ts @@ -10,7 +10,7 @@ import { getAppId, getProjectMeta, getUserPool, - replaceOverrideFileWitProjectInfo, + replaceOverrideFileWithProjectInfo, } from '@aws-amplify/amplify-e2e-core'; import { versionCheck, allowedVersionsToMigrateFrom } from '../../migration-helpers'; import { initJSProjectWithProfileV10 } from '../../migration-helpers-v10/init'; @@ -56,7 +56,7 @@ describe('amplify migration test auth', () => { // this is where we will write our override logic to const destOverrideFilePath = path.join(projRoot1, 'amplify', 'backend', 'auth', `${authResourceName}`, 'override.ts'); const srcOverrideFilePath = path.join(__dirname, '..', '..', '..', 'overrides', 'override-auth.ts'); - replaceOverrideFileWitProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); + replaceOverrideFileWithProjectInfo(srcOverrideFilePath, destOverrideFilePath, 'integtest', projectName); await amplifyPushOverride(projRoot1); const appId = getAppId(projRoot1);