Added unit test that would have caught the recent error code transform regression#11356
Conversation
|
Tangential but one downside of more efficient code is now we exercise the argument calculation code path less in tests. Which means that if it throws with some unusual inputs we might not know now. Because we'll only get invariant when we test specifically for it failing. On the other hand as far as I understand this was already happening as soon as a code was recorded anyway. Perhaps we should make an exception for tests and never wrap for them at all? |
|
While we're at it let's rename the test to match the transform new name? |
In general, I dig this suggestion, but I'm not sure how we'd make it work with tests like I think we'd actually need to run against the production build (eg
Sure. |
2e4905e to
1fa3a91
Compare
|
Sounds good. |
…m regression (facebook#11356) * Added an automated test that would have caught the recent error code transform bug * Renamed dev-expression-with-codes test to replace-invariant-error-codes * Formatting nit
Added an automated test that would have caught the regression introduced with #11291 and fixed by #11350.
The new test verifies that this:
Gets transformed to this:
Prior to #11291 it would not have been transformed (and so would have been slightly less efficient). After #11291 (with the regression) it would have failed with: