Skip to content

Commit c5945df

Browse files
authored
Allow passing additional configuration to the internal dynamo db… (#67)
Allow passing additional configuration to the internal dynamo db client
2 parents 4a7bcb3 + 9a4b096 commit c5945df

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

setup.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ const DEFAULT_OPTIONS = ['-sharedDb'];
1212

1313
module.exports = async function() {
1414
const config = require(resolve(cwd(), 'jest-dynamodb-config.js'));
15-
const {tables, port: port = DEFAULT_PORT, options: options = DEFAULT_OPTIONS} =
15+
const {tables, port: port = DEFAULT_PORT, options: options = DEFAULT_OPTIONS, clientConfig} =
1616
typeof config === 'function' ? await config() : config;
17+
1718
const dynamoDB = new DynamoDB({
18-
endpoint: 'localhost:' + port,
19+
endpoint: `localhost:${port}`,
1920
sslEnabled: false,
20-
region: 'local-env'
21+
region: 'local-env',
22+
...clientConfig
2123
});
24+
2225
global.__DYNAMODB__ = await DynamoDbLocal.launch(port, null, options);
2326

2427
await createTables(dynamoDB, tables);

0 commit comments

Comments
 (0)