Skip to content

Commit

Permalink
A deep dependency of yeoman just spams the console.log with giant jso…
Browse files Browse the repository at this point in the history
…n. This diff silences console.log around the require to kill them
  • Loading branch information
vjeux committed Sep 10, 2015
1 parent af05af7 commit e2ffac2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
13 changes: 12 additions & 1 deletion local-cli/__tests__/generator-ios-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
15 changes: 13 additions & 2 deletions local-cli/__tests__/generator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -46,4 +57,4 @@ describe('react:react', function() {

expect(stat.isDirectory()).toBe(true);
});
});
});

0 comments on commit e2ffac2

Please sign in to comment.