-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] #196 #214
[Fix] #196 #214
Conversation
As per @mitchellhamilton's suggestion, removing this part should be good enough.
@bogas04 can you please fill out basic information of this PR. It has a very vague title and none of the fields are filled out. I am much more likely to merge things that I can get the entire context of the situation. Thanks! |
@tkh44 I think it's per @mitchellhamilton request here #196 (comment) |
I understand that @thangngoc89, but I'm just asking nicely to use the provided template so that @mitchellhamilton and I can quickly scan the PR to get some context. |
@tkh44 Sorry for being lazy! I've added more details to the description. I often use commit messages like |
@mitchellhamilton I think the fix isn't working as intended. We output |
@bogas04 it should output undefined. As I said the optimisation I was trying to do by removing the undefined isn't needed. |
@mitchellhamilton Okay I understand. In that case, are we supposed to update the tests ? |
Yes |
Something like this in font-face.test.js.snap#L3 // Jest Snapshot v1, https://goo.gl/fbAQLP
- exports[`fontFace babel extract basic 1`] = `"import \\"./font-face.test.emotion.css\\";"`;
+ exports[`fontFace babel extract basic 1`] = `
+ "import \\"./font-face.test.emotion.css\\";"
+
+ undefined;
+ `; And in inject-global.test.js.snap#L22 as well. - exports[`babel injectGlobal extract injectGlobal basic 1`] = `"import \\"./inject-global.test.emotion.css\\";"`;
+ exports[`babel injectGlobal extract injectGlobal basic 1`] = `
+ "import \\"./inject-global.test.emotion.css\\";"
+
+ undefined;
+ `; ? |
Yes, that's exactly what it should be. |
perfect, onto it 👍 |
It looks like you updated the snapshots manually and they aren't don't match. I would recommend reading this to understand how snapshot tests work but basically press |
Codecov Report
@@ Coverage Diff @@
## master #214 +/- ##
=========================================
- Coverage 90.12% 90.1% -0.03%
=========================================
Files 22 22
Lines 952 950 -2
Branches 255 254 -1
=========================================
- Hits 858 856 -2
Misses 76 76
Partials 18 18
Continue to review full report at Codecov.
|
Thank you for supporting @mitchellhamilton 🎉 |
As per @mitchellhamilton's suggestion, removing this part should be good enough.
What: As per @mitchellhamilton #196 (comment), the if and else block is now just changed the contents of else block.
Why: This was causing an error on importing
injectGlobal
from 'emotion'.How: As per @mitchellhamilton "The optimisation ... isn't needed since uglify will remove the undefined expression anyway."
Checklist: