Skip to content

Commit

Permalink
chore: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Feb 22, 2023
1 parent 79499c3 commit 2c7937d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/amplify-e2e-core/src/utils/overrides.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-e2e-tests/src/__tests__/auth_6.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
getProjectMeta,
getUserPool,
initJSProjectWithProfile,
replaceOverrideFileWitProjectInfo,
replaceOverrideFileWithProjectInfo,
runAmplifyAuthConsole,
} from '@aws-amplify/amplify-e2e-core';
import * as path from 'path';
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-e2e-tests/src/__tests__/init_e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createNewProjectDir,
deleteProjectDir,
getProjectMeta,
replaceOverrideFileWitProjectInfo,
replaceOverrideFileWithProjectInfo,
} from '@aws-amplify/amplify-e2e-core';

import { addEnvironment } from '../environment/env';
Expand Down Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-e2e-tests/src/__tests__/storage-5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
initJSProjectWithProfile,
overrideDDB,
overrideS3,
replaceOverrideFileWitProjectInfo,
replaceOverrideFileWithProjectInfo,
updateDDBWithTrigger,
updateSimpleDDBwithGSI,
} from '@aws-amplify/amplify-e2e-core';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2c7937d

Please sign in to comment.