All files / tasks open.ts

100% Statements 10/10
75% Branches 3/4
100% Functions 2/2
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 171x 1x   2x 2x 2x   1x 1x       1x   1x    
import opn = require('open')
import { ITimplaTask, TIMPLA_PROCESS as TP } from '../internal'
 
export const open: ITimplaTask = timplaConfig => cb => {
  const env = TP.isProduction ? 'production' : 'development'
  const opnOptions = timplaConfig[env] && timplaConfig[env].open
  if (opnOptions === false) {
    cb()
    return
  }
  if (opnOptions) {
    // Set wait to false so build can terminate
    opn(opnOptions.target, { ...opnOptions.options, wait: false })
  }
  cb()
}