cypress-io / cypress-io/code-coverage

use-babelrc missing debug options to show source map

Open
#471 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
445
Forks
115
PR merge metrics
No merged PRs in 30d

Description

When we use `on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))` in the plugin/index.js file the source maps stop working. The source maps only show up if we have console.log in the tests.
Inside use-babelrc, we can see that browserify.defaultOptions has debug as undefined, so setting

```
const browserify = require('@cypress/browserify-preprocessor')

const options = browserify.defaultOptions
options.browserifyOptions.transform[1][1].babelrc = true
//adding the below line shows source map or else source map comes up only if console.log is added to a test file
options.browserifyOptions.debug = true
module.exports = browserify(options)
```
Related issue: https://github.com/cypress-io/cypress-browserify-preprocessor/issues/88

Note: not using use-babelrc or not preprocessing i.e. not having the below line in plugin/index.js will show sourcemaps, enabling this line without adding .debug=true disables sourcemap
`on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.