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

test,console: add testing for monkeypatching of console stdio #26561

Closed
wants to merge 1 commit into from

Commits on Mar 10, 2019

  1. test,console: add testing for monkeypatching of console stdio

    lib/internal/console/constructor.js contains setters for console._stdout
    and console._stderr but these setters are not used in our tests or in
    Node.js core. (This is confirmed by our nightly coverage reports.)
    
    Add a test to check monkeypatching _stdout and _stderr on a console
    object.
    
    Version 2.6.9 of the very-popular npm module `debug` used this
    monkeypatching in its code. No other version did and they are now at
    version 4.something. It is not inconceivable that we would want to
    change the setters to throw rather than work. Given that this has seen
    use in the ecosystem, I'm inclined to leave the functionality in place.
    Trott committed Mar 10, 2019
    Configuration menu
    Copy the full SHA
    2089f59 View commit details
    Browse the repository at this point in the history