Changed object properties to methods in order to get this to work with aws-sdk-mock. When running sls invoke testisOffline() will return false. Therefore, you must set IS_OFFFLINE=true as environment variable manually prior running test locally or you can add to your tests:
Changed object properties to methods in order to get this to work with
aws-sdk-mock
. When runningsls invoke test
isOffline()
will return false. Therefore, you must setIS_OFFFLINE=true
as environment variable manually prior running test locally or you can add to your tests:and
In the code use:
docClient = dynamodb.doc()
instead ofconst docClient = dynamodb.doc
. This will work with AWS, serverless offline and mocks.Additionally, made ESLint changes.