fix(testrunner): console.log in color (#3633)

This commit is contained in:
Joel Einbinder 2020-08-25 21:06:36 -07:00 committed by GitHub
parent 5f86253ad4
commit a6b9922eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,11 +16,18 @@
import { initializeImageMatcher } from './expect';
import { TestRunner, fixturePool } from './testRunner';
import { Console } from 'console';
let closed = false;
sendMessageToParent('ready');
global.console = new Console({
stdout: process.stdout,
stderr: process.stderr,
colorMode: process.env.FORCE_COLOR === '1',
});
process.stdout.write = chunk => {
if (testRunner && !closed)
testRunner.stdout(chunk);