-
Notifications
You must be signed in to change notification settings - Fork 820
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/amplify-e2e-tests/src/__tests__/function_15.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters