diff --git a/scripts/error-codes/__tests__/dev-expression-with-codes-test.js b/scripts/error-codes/__tests__/replace-invariant-error-codes-test.js similarity index 89% rename from scripts/error-codes/__tests__/dev-expression-with-codes-test.js rename to scripts/error-codes/__tests__/replace-invariant-error-codes-test.js index 958e32aa85d..11e8a35c2f6 100644 --- a/scripts/error-codes/__tests__/dev-expression-with-codes-test.js +++ b/scripts/error-codes/__tests__/replace-invariant-error-codes-test.js @@ -93,4 +93,13 @@ ${expectedInvariantTransformResult}` `_prodInvariant('18', 'Foo', 'Bar') : void 0;` ); }); + + it('should correctly transform invariants that are not in the error codes map', () => { + compare( + "invariant(condition, 'This is not a real error message.');", + `var _prodInvariant = require('shared/reactProdInvariant'); + +!condition ? invariant(false, 'This is not a real error message.') : void 0;` + ); + }); });