All files / src transformer.ts

60% Statements 6/10
50% Branches 1/2
100% Functions 1/1
60% Lines 6/10

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 18 19 20 21 225x 5x 5x   5x 2x                           2x    
import axios from 'axios';
import config from './config';
import * as logs from './logs';
 
export default async (payload) => {
  Iif (config.transformFunction) {
    try {
      await axios.post(`https://${config.location}-${config.projectId}.cloudfunctions.net/${config.transformFunction}`, {
        firstName: 'Fred',
        lastName: 'Flintstone'
      });
      return {
        ...payload,
        "hello": "world"
      }
    } catch (e) {
      logs.error(e);
    }
  }
  return payload;
}