Skip to content
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

jest-matchers fails on IE10 #4074

Closed
skovhus opened this issue Jul 19, 2017 · 15 comments · Fixed by #4367
Closed

jest-matchers fails on IE10 #4074

skovhus opened this issue Jul 19, 2017 · 15 comments · Fixed by #4367

Comments

@skovhus
Copy link
Contributor

skovhus commented Jul 19, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Running latests jest-matchers in a IE10 environment it fails with

19 07 2017 13:42:43.316:INFO [IE 10.0.0 (Windows 8 0.0.0)]: Connected on socket -C3IcIu9DHLMDYfIAAAE with id 90097551
IE 10.0.0 (Windows 8 0.0.0) ERROR
  Object expected
  at webpack:///~/jest-matchers/build-es5/index.js:4994:0 <- tests.webpack.js:5330
IE 10.0.0 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0.417 secs / 0 secs)

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

See

What is the expected behavior?
It shouldn't crash and the history tests should succeed.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
jest-matchers@20.1.0-delta.2

This is related to the work done in:

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

FYI @SimenB

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

These are always fun to debug...

@cpojer do we have a minimum supported browser target?

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

@SimenB @cpojer I think we at least needs to support IE10, which should be do-able. : )

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

Dug into this. Chalk uses Object.setPrototypeOf, which is transformed into some weird core-js thingy which fails. Not sure why it fails like it does? It's been over a year since I had to deal with this sort of error...

https://github.com/chalk/chalk/blob/23092eefd2401f1a41d9fb931ce9091ec2f624c5/index.js#L38-L39

image

The polyfill:

image

Is Rollup doing something weird?

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

Nice, reached the same conclusion just 5 minutes ago. 👍 (But should have use the nice debugger in IE like you did instead of console logs) 😊

screenshot 2017-07-20 00 12 30

Maybe some babel core stuff is not included correctly. 🤔

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

Maybe the polyfill doesn't work in IE10, seems like it relies on __proto__.

https://github.com/zloirock/core-js/blob/0bc7a9ea75fd1a604cc6c99eb755c32a08afda9a/library/modules/_set-proto.js

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

I'm using Babel with polyfills for a fairly big IE9 project (don't get me started on that), and everything just works there. So I think we can get it to work. : )

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

Yeah, we're hitting the undefined case there.

image

So we need to polyfill it for IE10.

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

I think babel-polyfill should do this.

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

babel-polyfill is just core-js. And core-js is unable to polyfill it

@SimenB
Copy link
Member

SimenB commented Jul 19, 2017

https://github.com/chalk/chalk/pull/163/files#r128383883

@skovhus
Copy link
Contributor Author

skovhus commented Jul 19, 2017

core-js is unable to polyfill it

I think you are right. : )

@SimenB
Copy link
Member

SimenB commented Jul 20, 2017

Special case to some stubbed-out implementation of Chalk when building for the browser? We don't care about the colors

@skovhus
Copy link
Contributor Author

skovhus commented Jul 20, 2017

Stubbed out version might be the best option right now. 👍🏻

As we are retrofitting browser support on a lot of dependencies, stubbing out dependencies might be also be useful in the future.

Running the Karma integration tests in IE10 would also be good to avoid regressions.

I'll it be able to look into this the next week. 😎🏝

@skovhus skovhus mentioned this issue Aug 24, 2017
6 tasks
SimenB added a commit to SimenB/jest that referenced this issue Aug 26, 2017
SimenB added a commit to SimenB/jest that referenced this issue Aug 27, 2017
cpojer pushed a commit that referenced this issue Aug 27, 2017
* Add a fake chalk in order to work in older browsers

Closes #4074

* Make fake chalk private

* fix import

* Normalize ansi-styles version

* Remove yarn.lock from npmignore

* Move fake chalk into expect package
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants