Unverified Commit 526c940a authored by Josh Gross's avatar Josh Gross Committed by GitHub
Browse files

Prevent commands from executing during tests (#21)

* Prevent commands from executing during tests

* Add newline at end of file

* Drop all commands from output
parent d676b6c3
Loading
Loading
Loading
Loading
+9
Changes for jest.config.js: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,3 +9,12 @@ module.exports = {
  },
  verbose: true
}

const processStdoutWrite = process.stdout.write.bind(process.stdout)
process.stdout.write = (str, encoding, cb) => {
  // Core library will directly call process.stdout.write for commands
  // We don't want :: commands to be executed by the runner during tests
  if (!str.match(/^::/)) {
    return processStdoutWrite(str, encoding, cb);
  }
}
 No newline at end of file