From 48527dca67df34cc872d1d1f3e6371d3a5af8c68 Mon Sep 17 00:00:00 2001 From: avnersorek Date: Thu, 21 Nov 2019 14:39:31 +0200 Subject: [PATCH 1/2] more logs --- setup.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.js b/setup.js index c592eca..1b9001f 100644 --- a/setup.js +++ b/setup.js @@ -15,11 +15,15 @@ module.exports = async function() { const {tables, port: port = DEFAULT_PORT, options: options = DEFAULT_OPTIONS} = typeof config === 'function' ? await config() : config; const dynamoDB = new DynamoDB({ - endpoint: 'localhost:' + port, + endpoint: `localhost:${port}`, sslEnabled: false, - region: 'local-env' + region: 'local-env', + logger: console }); - global.__DYNAMODB__ = await DynamoDbLocal.launch(port, null, options); + + const verbose = true; + + global.__DYNAMODB__ = await DynamoDbLocal.launch(port, null, options, verbose); await createTables(dynamoDB, tables); }; From 9a4b09604be3d52855d77c5c25cbfc589a54e812 Mon Sep 17 00:00:00 2001 From: avnersorek Date: Thu, 21 Nov 2019 18:14:12 +0200 Subject: [PATCH 2/2] adding clientConfig option --- setup.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.js b/setup.js index 1b9001f..0a48f7e 100644 --- a/setup.js +++ b/setup.js @@ -12,18 +12,17 @@ const DEFAULT_OPTIONS = ['-sharedDb']; module.exports = async function() { const config = require(resolve(cwd(), 'jest-dynamodb-config.js')); - const {tables, port: port = DEFAULT_PORT, options: options = DEFAULT_OPTIONS} = + const {tables, port: port = DEFAULT_PORT, options: options = DEFAULT_OPTIONS, clientConfig} = typeof config === 'function' ? await config() : config; + const dynamoDB = new DynamoDB({ endpoint: `localhost:${port}`, sslEnabled: false, region: 'local-env', - logger: console + ...clientConfig }); - const verbose = true; - - global.__DYNAMODB__ = await DynamoDbLocal.launch(port, null, options, verbose); + global.__DYNAMODB__ = await DynamoDbLocal.launch(port, null, options); await createTables(dynamoDB, tables); };