jest-dynamodb icon indicating copy to clipboard operation
jest-dynamodb copied to clipboard

UnknownEndpoint error

Open 0xBABA opened this issue 3 years ago • 1 comments

Hi

I am using this package for testing dynamo operations in a serverless framework project. My tests were timing out, after increasing the timeout value i am getting the following error:

UnknownEndpoint: Inaccessible host: 'localhost'. This service may not be available in the 'local-env' region. My configuration can be found here

So it seems like the local instance of dynamo is not running along with my tests. If I use serverless-offline, and start the "offline server" - my tests pass.

Is there any specific configuration required for this work in a serverless framework project that i might have missed?

Any advise would be much appreciated

0xBABA avatar Oct 27 '20 12:10 0xBABA

Not sure if this will help your case, but I solved this by directly including const dynamoDbPreset = require("@shelf/jest-dynamodb/jest-preset"); as part of the Jest configuration.

ianvonholt avatar Jan 24 '21 09:01 ianvonholt