How to use the common-tags.oneLine function in common-tags

To help you get started, we’ve selected a few common-tags examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kentcdodds / slice-js / integration / scripts / process-coverage.js View on Github external
.map(filepath => {
    const source = fs.readFileSync(filepath, 'utf8')
    const fileCoverage = allCoverage[filepath]
    const sliceInfo = sliceCodeAndGetInfo(source, fileCoverage)
    if (sliceInfo.error) {
      console.info(
        `${filepath} failed to slice:\n${sliceInfo.error.message}\n\n`,
      )
      console.info(
        oneLine(String.raw)`
          Here's the filtered coverage:
          \n\n${JSON.stringify(sliceInfo.filteredCoverage)}\n\n
        `,
      )
      console.info(`Here's the source:\n\n${source}\n\n`)
      // ignore...
    }
    return {filepath, source, slice: sliceInfo.slice}
  })
  .filter(({slice}) => !!slice)