gtsop / babel-jest-boost

🐠 🃏 🚀 - Brings tree-shaking to Jest, speeding up your test runs, using Babel
GNU Affero General Public License v3.0
8 stars 1 forks source link

feature: support commonJS presets #3

Closed maloguertin closed 1 month ago

maloguertin commented 1 month ago

🎯 Changes

Support babel configs that outputs commonJS

✅ Checklist

gtsop commented 1 month ago

Yes I see it now, looks legit. I'll fiddle a bit tomorrow with it and probably get it merged

gtsop-d commented 1 month ago

@maloguertin can you please do a rebase? The conflict is very simple, you just need to include both of our test case additions in the test file.

maloguertin commented 1 month ago

@maloguertin can you please do a rebase? The conflict is very simple, you just need to include both of our test case additions in the test file.

done!

gtsop-d commented 1 month ago

Hi @maloguertin we need to do just a bit more work here before we move on to the next PR.

As you can see i have pushed a new commit to blend together the utility functions you made onto the existing ones. I also extracted your test cases onto their own file since they solely concern preset-env integration. https://github.com/gtsop/babel-jest-boost/commit/df136e75c4cfa4ad5e4ef57d1aeaf751b94eaede

I have noticed that there is no test case that catches the bug you described here: https://github.com/gtsop/babel-jest-boost/pull/2#issuecomment-2274318008

If one removes the ternary statement in the getNewImport function you wrote, no test fails, thus we have a potential for regression, can you please craft a test case? Then we can make a release of 0.1.17 and move on to the next PR