@samitouri / QOS-React / commits / 7b5bdc14d8

Remove build time extractErrors message when error codes can't be found (#9555)

* Remove error message when error codes cannot be found * Re-record fiber tests to fix CI

Tom Occhino committed May 25, 2017 at 09:07 UTC 7b5bdc14d87de5a1c29c3a0effd816246c341937
3 files changed -36
scripts/error-codes/__tests__/dev-expression-with-codes-test.js
-24
@@ -115,28 +115,4 @@ ${expectedInvariantTransformResult}`
115 `_prodInvariant('18', 'Foo', 'Bar') : void 0;`
116 );
117 });
118 -
119 - it('should warn in non-test envs if the error message cannot be found', () => {
120 - spyOn(console, 'warn');
121 - transform("invariant(condition, 'a %s b', 'c');");
122 -
123 - expect(console.warn.calls.count()).toBe(1);
124 - expect(console.warn.calls.argsFor(0)[0]).toBe(
125 - 'Error message "a %s b" ' +
126 - 'cannot be found. The current React version ' +
127 - 'and the error map are probably out of sync. ' +
128 - 'Please run `yarn build -- --extractErrors` to build React with the error map in sync.'
129 - );
130 - });
131 -
132 - it('should not warn in test env if the error message cannot be found', () => {
133 - process.env.NODE_ENV = 'test';
134 -
135 - spyOn(console, 'warn');
136 - transform("invariant(condition, 'a %s b', 'c');");
137 -
138 - expect(console.warn.calls.count()).toBe(0);
139 -
140 - process.env.NODE_ENV = '';
141 - });
118 });
scripts/error-codes/dev-expression-with-codes.js
-10
@@ -117,16 +117,6 @@ module.exports = function(babel) {
117 if (prodErrorId === undefined) {
118 // The error cannot be found in the map.
119 node[SEEN_SYMBOL] = true;
120 - if (process.env.NODE_ENV !== 'test') {
121 - console.warn(
122 - 'Error message "' +
123 - errorMsgLiteral +
124 - '" cannot be found. The current React version ' +
125 - 'and the error map are probably out of sync. ' +
126 - 'Please run `yarn build -- --extractErrors` to ' +
127 - 'build React with the error map in sync.'
128 - );
129 - }
120 return;
121 }
122
scripts/fiber/tests-passing.txt
-2
@@ -28,8 +28,6 @@ scripts/error-codes/__tests__/dev-expression-with-codes-test.js
28 * should only add `reactProdInvariant` once
29 * should support invariant calls with args
30 * should support invariant calls with a concatenated template string and args
31 -* should warn in non-test envs if the error message cannot be found
32 -* should not warn in test env if the error message cannot be found
31
32 scripts/error-codes/__tests__/invertObject-test.js
33 * should return an empty object for an empty input