Created
October 27, 2020 12:47
-
-
Save 0xBABA/1fc4eb4e4ea1a2273392b52320ecfb84 to your computer and use it in GitHub Desktop.
jest-dynamodb connection error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isTest = process.env.JEST_WORKER_ID; | |
const options = { | |
convertEmptyValues: true, | |
...(isTest && { | |
endpoint: 'localhost:8000', | |
sslEnabled: false, | |
region: 'local-env', | |
}), | |
}; | |
const documentClient = new AWS.DynamoDB.DocumentClient(options); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
tables: [ | |
{ | |
TableName: 'AqDataTable-dev', | |
BillingMode: 'PAY_PER_REQUEST', | |
AttributeDefinitions: [ | |
{ | |
AttributeName: 'device_id', | |
AttributeType: 'S', | |
}, | |
{ | |
AttributeName: 'timestamp', | |
AttributeType: 'N', | |
}, | |
{ | |
AttributeName: 'org', | |
AttributeType: 'S', | |
}, | |
], | |
KeySchema: [ | |
{ | |
AttributeName: 'device_id', | |
KeyType: 'HASH', | |
}, | |
{ | |
AttributeName: 'timestamp', | |
KeyType: 'RANGE', | |
}, | |
], | |
}, | |
], | |
port: 8000, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment