Test your service locally, without having to deploy it first.
npm install
node_modules/.bin/sls deploy
node_modules/.bin/sls deploy function -f graphql
# via sls invoke
node_modules/.bin/sls invoke -f graphql --data '{ "queryStringParameters" : { "query" : "{value(key:\"Username\")}" } }'
node_modules/.bin/sls invoke -f graphql --data '{ "queryStringParameters" : { "query" : "mutation {value(key:\"Username\", value: \"Luca\")}" } }'
Run ./build.sh rebuild
to build docker images and running all required containers.
For further details, run ./build.sh --help
.
These kind of tests run locally, so we can check components logic (Unit) and the integration between dynamodb and graphql lambda api both offline.
Run ./run_tests.sh unit
.
Run ./run_tests.sh docker
.
These kind of tests run online in a isolated CF Stack, so we can verify user roles, policies and permissions and of course the integration between dynamodb and graphql lambda api both online.
Run ./run_tests.sh integration --stage testingstage
.