Skip to content

Commit

Permalink
add instructions for setting up lambda source directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry Kindall committed Apr 28, 2022
1 parent 78347c0 commit 154b2c8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions v1/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,20 @@ namespace AwsCdkAssertionSamples

------

## The Lambda function<a name="testing_lambda"></a>

Our example stack includes a Lambda function that starts our state machine\. We must provide the source code for this function so the CDK can bundle it up and deploy it as part of creating the Lambda function resource\.
+ Create the folder `start-state-machine` in the app's main directory\.
+ In this folder, create at least one file\. For example, you can save the code below in `start-state-machines/index.js`\.

```
exports.handler = async function (event, context) {
return 'hello world';
};
```

However, any file will work, since we won't actually be deploying the stack\.

## Running tests<a name="testing_running_tests"></a>

For reference, here are the commands you use to run tests in your AWS CDK app\. These are the same commands you'd use to run the tests in any project using the same testing framework\. For languages that require a build step, include that to make sure your tests have been compiled\.
Expand Down
14 changes: 14 additions & 0 deletions v2/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,20 @@ namespace AwsCdkAssertionSamples

------

## The Lambda function<a name="testing_lambda"></a>

Our example stack includes a Lambda function that starts our state machine\. We must provide the source code for this function so the CDK can bundle it up and deploy it as part of creating the Lambda function resource\.
+ Create the folder `start-state-machine` in the app's main directory\.
+ In this folder, create at least one file\. For example, you can save the code below in `start-state-machines/index.js`\.

```
exports.handler = async function (event, context) {
return 'hello world';
};
```

However, any file will work, since we won't actually be deploying the stack\.

## Running tests<a name="testing_running_tests"></a>

For reference, here are the commands you use to run tests in your AWS CDK app\. These are the same commands you'd use to run the tests in any project using the same testing framework\. For languages that require a build step, include that to make sure your tests have been compiled\.
Expand Down

0 comments on commit 154b2c8

Please sign in to comment.