Add fake chalk in browser builds in order to support IE10#4367
Add fake chalk in browser builds in order to support IE10#4367cpojer merged 6 commits intojestjs:masterfrom
Conversation
| * @flow | ||
| */ | ||
|
|
||
| import ansiStyles from 'ansi-styles'; |
There was a problem hiding this comment.
I thought about doing a try-catch around the normal chalk, and just create a fake one if it fails. But I don't think that matters?
| onwarn: () => {}, | ||
| plugins: [ | ||
| { | ||
| resolveId(id) { |
Codecov Report
@@ Coverage Diff @@
## master #4367 +/- ##
======================================
Coverage 56.2% 56.2%
======================================
Files 191 191
Lines 6411 6411
Branches 6 6
======================================
Hits 3603 3603
Misses 2805 2805
Partials 3 3Continue to review full report at Codecov.
|
|
As an alternative to this, could we use the previous version of Chalk? |
skovhus
left a comment
There was a problem hiding this comment.
Does the project have a browserstack or sauce labs account? Would be very nice to add this.
| @@ -0,0 +1,14 @@ | |||
| { | |||
| "name": "jest-fake-chalk", | |||
There was a problem hiding this comment.
Would it make sense to have this living outside the packages folder as it really isn't a package, but a stub used only in the browser build?
There was a problem hiding this comment.
then it's a bit messy plugging in dependencies, but I have no feelings on the matter
I don't think browser support should block updates to modules that doesn't even work in the browser anyways.
I don't know... |
| **/__mocks__/** | ||
| **/__tests__/** | ||
| src | ||
| yarn.lock |
There was a problem hiding this comment.
Done (technically we can remove the whole file since this will not be published)
|
Nice, thanks for fixing this stuff. I would prefer not to create a separate package for it, and putting |
|
I can move it to expect, sure. Can we set up browserstack or something similar? |
|
Could we somehow mock out the environment in Jest? Could that be sufficient for now? |
|
I can confirm that using the Example of assertion error in the terminal: (Stack trace is different because of #4035) |
|
Awesome @SimenB!
Agree. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |


Summary
Adds a new module
jest-fake-chalkwhich mocks out the entirechalkAPI in order forexpectto work in older browsers.The implementation is a noop (just returns the string it got as input).
Closes #4074
(First commit is from #4366, so you can merge that and I'll rebase, or just merge this).
/cc @skovhus @mjackson
Test plan
./jestand manually running browser test in IE10We should really look into getting browserstack or something set up!