Skip to content
Discussion options

You must be logged in to vote

In case someone else will stumble on this issue, here is a bit more detailed explanation:

I renamed all test files in tests/tap to have the same names as the source file in src, then I created a small coverage-map.js file that exports a default function that maps each test file to the corresponding source file:

export default function getCoverageMapFiles (testFilePath) { 
  const sourceFilePath = testFilePath.replace(/tests\/tap/, 'src')
  // console.log(`Getting coverage map for source file: ${sourceFilePath}`)
  return sourceFilePath
}

When I run a single test, I pass this file to tap run via the ----coverage-map= option:

   "test-one": "tap run --reporter=tap --coverage-map=tests/cover…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@isaacs
Comment options

Answer selected by ilg-ul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants