Closed TehZarathustra closed 4 years ago
Hi @TehZarathustra, thank you for the issue and sorry for the delay!
The problem here is with identity-obj-proxy
, because it makes a proxy on styles
from .css
, and every value returns it's key, event the symbol, that reshadow
uses for some caching and internal needs.
I'd suggest to declare this kind of proxy
:
/**
* Proxy that works with reshadow, which uses symbols in styles
*
* @see https://github.com/keyz/identity-obj-proxy/blob/06716fbb8f4fb1cab0b66d7d9b474bed628a4766/src/index.js
*/
module.exports = new Proxy(
{},
{
get(target, key) {
if (typeof key === 'symbol') {
return target[key];
}
if (key === '__esModule') {
return false;
}
return key;
},
},
);
And in your jest.config.js:
"moduleNameMapper": {
".*\\.(sass|svg|png|jpg)$": "identity-obj-proxy",
"\\.css$": "<rootDir>/your-own-identity-obj-proxy",
},
Hope it helps.
It does. Thanks a lot!
Hey! Recently i've started using component library, which has reshadow in it The problem is when i try to test (jest, enzyme) components with that lib i get the error
I've tried adding
reshadow/babel
to babel config, but it had no effectbabel.config.js
jest.config
Thanks!