All files / if-check/util helpers.ts

100% Statements 10/10
100% Branches 0/0
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 181x   1x         1x 1x   1x 1x 1x   1x 1x    
import {STRINGS} from '../config';
 
const {IF_CHECK_FAILED, IF_CHECK_SUMMARY_ERROR_MESSAGE} = STRINGS;
 
/**
 * Logs the failure message from the stdout of an error.
 */
export const logStdoutFailMessage = (error: any, fileName: string) => {
  console.log(IF_CHECK_FAILED(fileName));
 
  const stdout = error.stdout;
  const logs = stdout.split('\n\n');
  const failMessage = logs[logs.length - 1];
 
  console.log(failMessage);
  return IF_CHECK_SUMMARY_ERROR_MESSAGE(fileName, failMessage);
};