From e2ffac28e419fe6fe69c13b48bd4016401bb918d Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 10 Sep 2015 09:48:15 -0700 Subject: [PATCH] A deep dependency of yeoman just spams the console.log with giant json. This diff silences console.log around the require to kill them --- local-cli/__tests__/generator-ios-test.js | 13 ++++++++++++- local-cli/__tests__/generator-test.js | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/local-cli/__tests__/generator-ios-test.js b/local-cli/__tests__/generator-ios-test.js index ed3bb9728..43bd6ca7c 100644 --- a/local-cli/__tests__/generator-ios-test.js +++ b/local-cli/__tests__/generator-ios-test.js @@ -5,10 +5,21 @@ jest.autoMockOff(); var path = require('path'); describe('react:ios', function() { - var assert = require('yeoman-generator').assert; + var assert; beforeEach(function() { + // A deep dependency of yeoman spams console.log with giant json objects. + // yeoman-generator/node_modules/ + // download/node_modules/ + // caw/node_modules/ + // get-proxy/node_modules/ + // rc/index.js + var log = console.log; + console.log = function() {}; + assert = require('yeoman-generator').assert; var helpers = require('yeoman-generator').test; + console.log = log; + var generated = false; runs(function() { diff --git a/local-cli/__tests__/generator-test.js b/local-cli/__tests__/generator-test.js index f138c8dd6..04c7c1c16 100644 --- a/local-cli/__tests__/generator-test.js +++ b/local-cli/__tests__/generator-test.js @@ -6,10 +6,21 @@ var path = require('path'); var fs = require('fs'); describe('react:react', function() { - var assert = require('yeoman-generator').assert; + var assert; beforeEach(function() { + // A deep dependency of yeoman spams console.log with giant json objects. + // yeoman-generator/node_modules/ + // download/node_modules/ + // caw/node_modules/ + // get-proxy/node_modules/ + // rc/index.js + var log = console.log; + console.log = function() {}; + assert = require('yeoman-generator').assert; var helpers = require('yeoman-generator').test; + console.log = log; + var generated = false; runs(function() { @@ -46,4 +57,4 @@ describe('react:react', function() { expect(stat.isDirectory()).toBe(true); }); -}); \ No newline at end of file +});