/* * Fetches AWS credentials from the current environment * either from env vars, or .env file in the /tests directory */ const getCredentials = () => { const credentials = { aws: { accessKeyId: process.env.AWS_ACCESS_KEY_ID || dotenv.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || dotenv.AWS_SECRET_ACCESS_KEY, }, }; if (!credentials.aws.accessKeyId || !credentials.aws.accessKeyId) { throw new Error('Unable to run tests. AWS credentials not found in the envionrment'); } return credentials; }