Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable source code minify? #931

Closed
IgorNovozhilov opened this issue Oct 24, 2018 · 8 comments
Closed

How to disable source code minify? #931

IgorNovozhilov opened this issue Oct 24, 2018 · 8 comments

Comments

@IgorNovozhilov
Copy link

IgorNovozhilov commented Oct 24, 2018

How to disable source code minify at startup nyc?
default

@stale stale bot added the wontfix label Jan 5, 2019
@IgorNovozhilov
Copy link
Author

How?

@JaKXz JaKXz added question and removed wontfix labels Jan 10, 2019
@JaKXz
Copy link
Member

JaKXz commented Jan 10, 2019

@IgorNovozhilov could you provide a minimal reproduction in a public repo? Since there are so many moving parts we need that to help understand your problem

@IgorNovozhilov
Copy link
Author

IgorNovozhilov commented Jan 10, 2019

git clone git@github.com:demo-source/nyc-issues-931.git
cd nyc-issues-931/
npm i
node_modules/.bin/nyc npm test

output

ReferenceError: undefFunc is not defined
    at Object.myFunction (/home/igor/development/test/nyc-issues-931/work.js:1:973)
    at myTest (/home/igor/development/test/nyc-issues-931/test.js:4:10)
    at Object.<anonymous> (/home/igor/development/test/nyc-issues-931/test.js:7:1)

just for npm test

ReferenceError: undefFunc is not defined
    at Object.myFunction (/home/igor/development/test/nyc-issues-931/work.js:2:5)
    at myTest (/home/igor/development/test/nyc-issues-931/test.js:4:10)
    at Object.<anonymous> (/home/igor/development/test/nyc-issues-931/test.js:7:1)

config in package.json

    "nyc": {
        "exclude": [
            "test.js"
        ]
    }

work.js:1:973 - is minified
test.js:7:1 - is not minified
How can I make the work.js file not be minified, that would be in the test report to understand where the error in the source file?

@istanbuljs istanbuljs deleted a comment from stale bot Jan 24, 2019
@coreyfarrell
Copy link
Member

NYC supports a compact: false configuration option or command-line nyc --compact=false node ./test.js. Note lines still will not line up to the original source as instrumentation code is inserted to the source. For this you will need to enable produce-source-map in nyc and use source-map-support. I've had mixed results testing with that module... it's complicated.

The --compact option is documented in nyc --help, the config option is not documented (probably should be).

@IgorNovozhilov
Copy link
Author

@coreyfarrell. Tried a lot of things, '--compact=false', including. So far, the best option is to restart the tests if they fall. But without 'nyc'

$ nyc npm test || npm test

it's a best option, short and easy 🙂

@stale
Copy link

stale bot commented Mar 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 27, 2019
@IgorNovozhilov
Copy link
Author

жаль, что это не будет поддержано

@andinoJamesV
Copy link

andinoJamesV commented May 30, 2020

NYC supports a compact: false configuration option or command-line nyc --compact=false node ./test.js. Note lines still will not line up to the original source as instrumentation code is inserted to the source. For this you will need to enable produce-source-map in nyc and use source-map-support. I've had mixed results testing with that module... it's complicated.
The --compact option is documented in nyc --help, the config option is not documented (probably should be).

Do you have any suggestions about making this function ?

#1323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants