lambda-refarch-webapp
lambda-refarch-webapp copied to clipboard
Unable to test locally
Reproduction Steps
(ins)[hendry@t14s todo-src]$ npm run test
> [email protected] test
> mocha tests/unit/
Error: No test files found: "tests/unit/"
I also tried following the steps in the README, but the dynamodb create-table line doesn't work
(ins)[hendry@t14s ~]$ aws dynamodb create-table --table-name TodoTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --endpoint-url http://127.0.0.1:8000
You must specify a region. You can also configure your region by running "aws configure".
(ins)[hendry@t14s ~]$ aws --region ap-southeast-1 dynamodb create-table --table-name TodoTable --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --endpoint-url http://127.0.0.1:8000
Unable to locate credentials. You can configure credentials by running "aws configure".
(ins)[hendry@t14s ~]$ aws --version
aws-cli/2.2.39 Python/3.8.8 Linux/5.14.8-arch1-1 exe/x86_64.arch prompt/off
This is :bug: Bug Report
Also it's not super clear to me if or how https://github.com/aws-samples/lambda-refarch-webapp/blob/master/todo-src/test/unit/test-handler.js gets used
@kaihendry the test folder name is wrong. It should be "test/unit/"