All files / src/models exit-strategy-option.js

42.85% Statements 9/21
50% Branches 3/6
100% Functions 2/2
42.85% Lines 9/21

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 22193x 10x           10x 10x 193x 193x 193x 2x               2x  
export function get(follow, exitOnDeploy) {
  if (follow) {
    if (exitOnDeploy === 'deploy-start') {
      throw new Error('The `follow` and `exit-on` set to "deploy-start" options are not compatible');
    }
    return 'never';
  }
  return exitOnDeploy;
}
 
// plotQuietWarning: If in quiet mode and exitStrategy set to never plot a warning to indicate that the command will end
export function plotQuietWarning(exitStrategy, quiet) {
  if (exitStrategy === 'never' && quiet) {
    Logger.println(
      styleText(
        ['bold', 'yellow'],
        'The "never" exit-on strategy is not compatible with the "quiet" mode, it will exit once the deployment ends',
      ),
    );
  }
}