Skip to content

Commit

Permalink
chore: fixed lambda name (#12815)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazpavel authored Jun 16, 2023
1 parent 007e994 commit 490b3df
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
42 changes: 42 additions & 0 deletions packages/amplify-e2e-tests/src/__tests__/function_15.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
addFunction,
amplifyPushAuth,
createNewProjectDir,
deleteProject,
deleteProjectDir,
generateRandomShortId,
initJSProjectWithProfile,
loadFunctionTestFile,
overrideFunctionSrcNode,
} from '@aws-amplify/amplify-e2e-core';
import { v4 as uuid } from 'uuid';

describe('amplify push function cases:', () => {
let projRoot: string;

beforeEach(async () => {
projRoot = await createNewProjectDir('multiple-function-push');
});

afterEach(async () => {
await deleteProject(projRoot);
deleteProjectDir(projRoot);
});

it('should be able to push multiple functions at the same time', async () => {
const projName = `multilambda${generateRandomShortId()}`;
await initJSProjectWithProfile(projRoot, { name: projName });

const [shortId] = uuid().split('-');
const functionName = `nodetestfunction${shortId}`;

await addFunction(projRoot, { functionTemplate: 'Hello World', name: functionName }, 'nodejs');
await amplifyPushAuth(projRoot);

const functionCode = loadFunctionTestFile('case-function.js').replace('{{testString}}', 'Hello from Lambda!');
overrideFunctionSrcNode(projRoot, functionName, functionCode);
await addFunction(projRoot, { functionTemplate: 'Hello World' }, 'python');

await amplifyPushAuth(projRoot);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,10 @@ export const updateStackForAPIMigration = async (context: $TSContext, category:

const prepareBuildableResources = async (context: $TSContext, resources: $TSAny[]): Promise<void> => {
// Only build and package resources which are required
await Promise.all(resources.filter((resource) => resource.build).map((resource) => prepareResource(context, resource)));
const resourcesToBuild = resources.filter((resource) => resource.build);
for (const resource of resourcesToBuild) {
await prepareResource(context, resource);
}
};

const prepareResource = async (context: $TSContext, resource: $TSAny) => {
Expand Down

0 comments on commit 490b3df

Please sign in to comment.