All files / src/common_services/lambda lambdaService.ts

100% Statements 11/11
100% Branches 2/2
100% Functions 1/1
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1819x 19x 19x 19x     19x     75x 75x 1x   74x        
import { Injectable } from '@nestjs/common';
import AWSXRay from 'aws-xray-sdk';
import AWS from 'aws-sdk';
import { EnvironmentService } from '../config';
 
@Injectable()
export class LambdaService {
  lambda: AWS.Lambda;
 
  constructor(private readonly envService: EnvironmentService) {
    if (envService.isInLambda) {
      this.lambda = AWSXRay.captureAWSClient(new AWS.Lambda());
    } else {
      this.lambda = new AWS.Lambda();
    }
  }
}