Skip to content

get the default process.stdout.write back after tests are finished #1582

Closed
@stevemao

Description

@stevemao

I have a test which tests stdout so I need to change the default behaviour of process.stdout.

process.stdout.write = (function(write) {
    return function(string, encoding, fd) {
      var args = _.toArray(arguments);
      callback.call(callback, string);
    };
  }(process.stdout.write));

mocha's report, however, cannot be seen any more if I use this. It would be good if mocha remembers the default process.stdout.write at the beginning and change it back after tests are finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions