Closed m-bock closed 3 years ago
This PR LGTM at this point, I would just like @gcanti to review prior to merging since we are resolving a bug here.
Thanks @thought2, @gcanti, and @gillchristian! PR is merged 👍
Released, thank you 👍
nice! And thanks for the invite to collaborate!
We need to assure many possible import statements are replaced correctly:
/lib
As writing out tests manually for all those combinations would be a bit too much. I tried to abstract the tests a bit to reduce boilerplate. Since Jest 26 there is a feature available that works well for this purpose: https://jestjs.io/docs/api#testeachtablename-fn-timeout
For this I had to upgrade Jest and and adjust a few places in the codebase to make the tests work with the new version.
Finally the actual implementation of the replacement logic is a single regex and one replacement call.