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:
parent
3080b8d26c
commit
0eea9c61ee
|
@ -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');
|
||||
|
|
|
@ -18,6 +18,10 @@ mockColor.bold = function() {
|
|||
return {};
|
||||
};
|
||||
|
||||
mockColor.bgRed = function() {
|
||||
return {};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
dim: s => s,
|
||||
magenta: mockColor,
|
||||
|
|
Loading…
Reference in New Issue