added new property to mock in chalk.js

Summary:
Tests started [failing](https://travis-ci.org/facebook/react-native/jobs/163517412) with release of new  babel that uses chalk.white.bgRed in code.
Jest does not like chalk and needs it mocked.
Removed code duplication and patched the mock.
Closes https://github.com/facebook/react-native/pull/10169

Differential Revision: D3943493

Pulled By: davidaurelio

fbshipit-source-id: 11f57f60ed909a394f15de7b9cc511400aeff510
This commit is contained in:
Konstantin Raev 2016-09-29 04:06:22 -07:00 committed by Facebook Github Bot
parent 3080b8d26c
commit 0eea9c61ee
2 changed files with 6 additions and 23 deletions

View File

@ -8,26 +8,5 @@
*/
'use strict';
const mockColor = () => {
return {
bold: () => { return { }; },
};
};
mockColor.bold = function() {
return {};
};
module.exports = {
dim: s => s,
magenta: mockColor,
white: mockColor,
blue: mockColor,
yellow: mockColor,
green: mockColor,
bold: mockColor,
red: mockColor,
cyan: mockColor,
gray: mockColor,
black: mockColor,
};
module.exports =
require('../../packager/react-packager/src/Activity/__mocks__/chalk.js');

View File

@ -18,6 +18,10 @@ mockColor.bold = function() {
return {};
};
mockColor.bgRed = function() {
return {};
};
module.exports = {
dim: s => s,
magenta: mockColor,