UNPKG

simple-lambda-client

Version:

A simple, convenient way to invoke aws lambda functions with best practices.

27 lines 1.21 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const dotenv_1 = __importDefault(require("dotenv")); const testIfNotCicd_1 = require("./__test_utils__/testIfNotCicd"); const invokeLambdaFunction_1 = require("./invokeLambdaFunction"); // load environmental variables from .env dotenv_1.default.config(); // load test details from env vars const testPayload = process.env.EXECUTE_PAYLOAD; const serviceName = process.env.EXECUTE_SERVICE_NAME; const functionName = process.env.EXECUTE_FUNCTION_NAME; const stage = process.env.EXECUTE_STAGE; describe('createLambdaServiceClient', () => { (0, testIfNotCicd_1.testIfNotCicd)('should be able to call service and get response', async () => { const result = await (0, invokeLambdaFunction_1.invokeLambdaFunction)({ service: serviceName, stage, function: functionName, event: JSON.parse(testPayload), }); expect(result).toEqual({ job: null }); }); }); //# sourceMappingURL=invokeLambdaFunction.integration.test.js.map